Jump to content
Steven Dang

ERROR with LAFireStation.script

Recommended Posts

Hello everyone, as the name of the topic, i modified the script and then i get an error: "error: unexpected EOF_exec_statement()". Does it need LAFireStationStart.script together for using??

 

here is my code. Hope to see your help.

//******************************************************************************************
// #Version 1.4#
//
// 		Includes: All command for the fire station.
//
//	- VcmdAlarm
//	- VcmdRoof
//	- VcmdGarageDoorsUp
//	- VcmdGarageDoorsDown
//	- VcmdCallEMT
//	- VcmdCallEMTSCBA
//	- VcmdCallEMTStretcher
//	- VcmdCallPM
//	- VcmdCallPMSCBA
//	- VcmdCallPMStretcher
//	- VcmdCallDiver
//	- VcmdCallHazmat
//	- VcmdCallUSARFF
//	- VcmdEmptyFireStation
//	- DummyDisableAlarm
//	- DummyCallCrew
//	- DummyGates
//
//		Script by Hoppah
//    		Modified by ShaneGreen
//		
//		Usage of this script in other mods is NOT allowed without permission of Hoppah
//
//******************************************************************************************

const char NAME_FIRESTATION[]			= "fire_station";
//const char NAME_FIRESTATION_ROOF[]		= "fire_station_roof";
const char NAME_FIRESTATION2[]			= "fire_station2";
//const char NAME_FIRESTATION2_ROOF[]		= "fire_station2_roof";
const char NAME_FIRESTATION3[]    		= "fire_station3";
const char NAME_CONTROLPANEL[]			= "fire_station_controlpanel";
const char NAME_CONTROLPANEL2[]			= "fire_station_controlpanel2";
const char NAME_CONTROLPANEL3[]			= "fire_station_controlpanel3";

const char OBJ_BATT12[]				= "mod:Prototypes/Vehicles/02 LA Fire Department/Battalion 12.e4p";
const char OBJ_ENGINE1[]			= "mod:Prototypes/Vehicles/02 LA Fire Department/Engine 1.e4p";
const char OBJ_ENGINE12[]			= "mod:Prototypes/Vehicles/02 LA Fire Department/Kamaz.e4p";
const char OBJ_ENGINE2[]			= "mod:Prototypes/Vehicles/02 LA Fire Department/Engine 2.e4p";
const char OBJ_ENGINE3[]			= "mod:Prototypes/Vehicles/02 LA Fire Department/Engine 3.e4p";
const char OBJ_ENGINE5[]			= "mod:Prototypes/Vehicles/02 LA Fire Department/Engine 5.e4p";
const char OBJ_LADDER1[]			= "mod:Prototypes/Vehicles/02 LA Fire Department/Ladder 1.e4p";
const char OBJ_LADDER2[]			= "mod:Prototypes/Vehicles/02 LA Fire Department/Ladder 2.e4p";
const char OBJ_LADDER3[]			= "mod:Prototypes/Vehicles/02 LA Fire Department/Ladder 3.e4p";
const char OBJ_FOAM4[]				= "mod:Prototypes/Vehicles/02 LA Fire Department/Foam 4.e4p";
const char OBJ_CRANE[]				= "mod:Prototypes/Vehicles/02 LA Fire Department/Restruck.e4p";
const char OBJ_SQUAD1[]				= "mod:Prototypes/Vehicles/02 LA Fire Department/Squad 1.e4p";
const char OBJ_TANKER1[]			= "mod:Prototypes/Vehicles/02 LA Fire Department/water_tanker.e4p";
const char OBJ_TANKER3[]			= "mod:Prototypes/Vehicles/02 LA Fire Department/Engine 12.e4p";
const char OBJ_SQUAD3[]				= "mod:Prototypes/Vehicles/02 LA Fire Department/Squad 3.e4p";
const char OBJ_HAZMAT4[]			= "mod:Prototypes/Vehicles/02 LA Fire Department/Hazmat 4.e4p";
const char OBJ_FORESTRY1[]			= "mod:Prototypes/Vehicles/02 LA Fire Department/Forestry 1.e4p";
const char OBJ_FORESTRY3[]			= "mod:Prototypes/Vehicles/02 LA Fire Department/Forestry 3.e4p";
const char OBJ_FOAM42[]			    = "mod:Prototypes/Vehicles/02 LA Fire Department/Foam 42.e4p";
const char OBJ_COMMAND[] 				= "mod:Prototypes/Vehicles/03 LA Police/SWAT Command.e4p";

const char OBJ_EMS12[]				= "mod:Prototypes/Vehicles/01 LA Ambulance/EMS 12.e4p";
const char OBJ_MEDIC1[]				= "mod:Prototypes/Vehicles/01 LA Ambulance/Medic 1.e4p";
const char OBJ_MEDIC12[]			= "mod:Prototypes/Vehicles/01 LA Ambulance/Medic 12.e4p";
const char OBJ_MEDIC2[]				= "mod:Prototypes/Vehicles/01 LA Ambulance/Medic 2.e4p";
const char OBJ_MEDIC3[]				= "mod:Prototypes/Vehicles/01 LA Ambulance/Medic 3.e4p";
const char OBJ_MEDIC5[]				= "mod:Prototypes/Vehicles/01 LA Ambulance/Medic 5.e4p";
const char OBJ_MEDIC52[]			= "mod:Prototypes/Vehicles/01 LA Ambulance/Medic 52.e4p";

const char OBJ_CHIEF[]				    = "mod:Prototypes/Persons/02 LA Fire Department/battalion_chief.e4p";
//const char OBJ_CAPTAIN[]			    = "mod:Prototypes/Persons/02 LA Fire Department/ff_captain.e4p";
const char OBJ_EMT[]				      = "mod:Prototypes/Persons/02 LA Fire Department/ff_emt.e4p";
//const char OBJ_EMT_SCBA[]			    = "mod:Prototypes/Persons/02 LA Fire Department/ff_emt_scba.e4p";
//const char OBJ_EMT_STRETCHER[]		= "mod:Prototypes/Persons/02 LA Fire Department/ff_emt_stretcher.e4p";
//const char OBJ_EMS_CAPTAIN[]			= "mod:Prototypes/Persons/01 LA Ambulance/ems_paramedic_captain.e4p";
//const char OBJ_PM[]				        = "mod:Prototypes/Persons/01 LA Ambulance/ff_paramedic.e4p";
//const char OBJ_PM_SCBA[]			    = "mod:Prototypes/Persons/01 LA Ambulance/ff_paramedic_scba.e4p";
//const char OBJ_PM_STRETCHER[]			= "mod:Prototypes/Persons/01 LA Ambulance/ff_paramedic_stretcher.e4p";
const char OBJ_HAZMAT[]				= "mod:Prototypes/Persons/02 LA Fire Department/ff_hazmat.e4p";
//const char OBJ_USARFF[]				= "mod:Prototypes/Persons/02 LA Fire Department/usar_ff.e4p";
const char OBJ_DIVER[]				= "mod:Prototypes/Persons/02 LA Fire Department/ff_diver.e4p";
const char OBJ_USFS[]				= "mod:Prototypes/Persons/02 LA Fire Department/usfs_ff.e4p";

const char VO_BATT12[]				= "Battalion12";
const char VO_ENGINE1[]				= "Engine1";
const char VO_ENGINE12[]			= "Engine12";
const char VO_ENGINE2[]				= "Engine2";
const char VO_ENGINE3[]				= "Engine3";
const char VO_ENGINE5[]				= "Engine5";
const char VO_LADDER1[]				= "Ladder1";
const char VO_LADDER2[]				= "Ladder2";
const char VO_LADDER3[]				= "Ladder3";
const char VO_FOAM4[]				= "Foam4";
const char VO_CRANE[]				= "Crane";
const char VO_SQUAD1[]				= "Squad1";
const char VO_TANKER1[]				= "Tanker1";
const char VO_TANKER3[]				= "Tanker3";
const char VO_SQUAD3[]				= "Squad3";
const char VO_HAZMAT4[]				= "Hazmat4";
const char VO_FOAM42[]				= "Foam42";
const char VO_FORESTRY1[]			= "Forestry1";
const char VO_FORESTRY3[]			= "Forestry3";
const char VO_COMMAND[]				= "Command";
const char VO_EMS12[]				= "EMS12";
const char VO_MEDIC1[]				= "Medic1";
const char VO_MEDIC12[]				= "Medic12";
const char VO_MEDIC2[]				= "Medic2";
const char VO_MEDIC3[]				= "Medic3";
const char VO_MEDIC5[]				= "Medic5";
const char VO_MEDIC52[]				= "Medic52";

//const char DUMMY_GATES[]			= "DummyGates";
const char DUMMY_ALARM[]			= "DummyDisableAlarm";
const char DUMMY_CALLCREW[]			= "DummyCallCrew";


const char VO_MOVETO01[]			= "moveto01";
const char VO_MOVETO02[]			= "moveto02";
const char VO_MOVETO03[]			= "moveto03";
const char VO_SPAWN01[]				= "spawn01";
const char VO_SPAWN02[]				= "spawn02";
const char VO_SPAWN03[]				= "spawn03";
const char VO_SQUAD01[]				= "squad01";
const char VO_SQUAD02[]				= "squad02";
const char VO_SQUAD03[]				= "squad03";
	

const char SND_ALARM[]				= "mod:Audio/FX/Misc/fire_alarm.wav";
const char SND_ALARM1[]				= "mod:Audio/FX/Misc/fire_alarm1.wav";
const char SND_ALARM2[]				= "mod:Audio/FX/Misc/fire_alarm2.wav";
const char SND_ALARM3[]				= "mod:Audio/FX/Misc/fire_alarm3.wav";
//const char SND_GATE[]				  = "mod:Audio/FX/Misc/fire_gate.wav";

//const char ANI_CLOSE[]				= "close";
//const char ANI_OPEN[]				= "open";
const char VOSET_ROAD[]				= "Freely Accessible";
const char VOSET_BARRICADE[]			= "Barricade";

const char UNNAMED[]				= "Unnamed";

int DummyGroup = 20;

object VcmdAlarm : CommandScript
{
	VcmdAlarm()
	{
		SetCursor("alarm");
		SetIcon("alarm");
		SetPriority(200);
	}

	bool CheckPossible(GameObject *Caller)
	{
		if (!Caller->IsValid())
			return false;

		if (!Game::IsFreeplay() && !Game::IsMultiplayer())
			return true;

		Vehicle v(Caller);
		if (v.HasCommand(DUMMY_ALARM))
			return false;

		return true;
	}

	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
	{
		if (!Caller->IsValid() || !Target->IsValid() || (Caller->GetID() != Target->GetID()))
			return false;

		return true;
	}

	void PushActions(GameObject *Caller, Actor *Target, int ChildID)
	{
		if(Caller->HasName(NAME_CONTROLPANEL)) //= fire station 1
		{
			Caller->AssignCommand(DUMMY_ALARM);
			Caller->PushActionWait(ACTION_NEWLIST, 1.5f);
			//Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_GATES, Caller, 1, false);
			//Caller->PushActionWait(ACTION_APPEND, 13.0f);
			Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_ALARM, Caller, 1, false);
			GameObjectList l1 = Game::GetGameObjects(NAME_FIRESTATION);
			for(int i=0; i < l1.GetNumObjects(); i++)
			{
				GameObject *obj = l1.GetObject(i);
				if (!obj->IsSpecialLightEnabled())
				{
					obj->EnableSpecialLights(true);
					Vector AlarmSnd = obj->GetPosition();
					int soundID = Audio::PlaySample3D(SND_ALARM1, AlarmSnd, true);
					obj->SetUserData(soundID);
					obj->AttachSound(soundID);
				}
			}
			GameObjectList l2;
 			Game::CollectObstaclesOnVirtualObject(VO_SQUAD1, l2, ACTOR_VEHICLE);
			if(l2.GetNumObjects() > 0)
			{
				Vehicle m = l2.GetObject(0);
				PersonList passengers = m.GetPassengers();
				if (passengers.GetNumPersons() == 0)
				{
					m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 4, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
				}
			}
			GameObjectList l3;
 			Game::CollectObstaclesOnVirtualObject(VO_ENGINE1, l3, ACTOR_VEHICLE);
			if(l3.GetNumObjects() > 0)
			{
				Vehicle m = l3.GetObject(0);
				PersonList passengers = m.GetPassengers();
				if (passengers.GetNumPersons() == 0)
				{
					m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 4, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
				}
			}
			GameObjectList l4;
 			Game::CollectObstaclesOnVirtualObject(VO_TANKER3, l4, ACTOR_VEHICLE);
			if(l4.GetNumObjects() > 0)
			{
				Vehicle m = l4.GetObject(0);
				PersonList passengers = m.GetPassengers();
				if (passengers.GetNumPersons() == 0)
				{
					m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 4, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
				}
			}
			GameObjectList l5;
 			Game::CollectObstaclesOnVirtualObject(VO_ENGINE5, l5, ACTOR_VEHICLE);
			if(l5.GetNumObjects() > 0)
			{
				Vehicle m = l5.GetObject(0);
				PersonList passengers = m.GetPassengers();
				if (passengers.GetNumPersons() == 0)
				{
					m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 4, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
				}
			}
			GameObjectList l6;
 			Game::CollectObstaclesOnVirtualObject(VO_LADDER1, l6, ACTOR_VEHICLE);
			if(l6.GetNumObjects() > 0)
			{
				Vehicle m = l6.GetObject(0);
				PersonList passengers = m.GetPassengers();
				if (passengers.GetNumPersons() == 0)
				{
					m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
				}
			}
			GameObjectList l7;
 			Game::CollectObstaclesOnVirtualObject(VO_TANKER1, l7, ACTOR_VEHICLE);
			if(l7.GetNumObjects() > 0)
			{
				Vehicle m = l7.GetObject(0);
				PersonList passengers = m.GetPassengers();
				if (passengers.GetNumPersons() == 0)
				{
					m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
				}
			}
			GameObjectList l8;
 			Game::CollectObstaclesOnVirtualObject(VO_ENGINE12, l8, ACTOR_VEHICLE);
			if(l8.GetNumObjects() > 0)
			{
				Vehicle m = l8.GetObject(0);
				PersonList passengers = m.GetPassengers();
				if (passengers.GetNumPersons() == 0)
				{
					m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
				}
			}
			GameObjectList l9;
 			Game::CollectObstaclesOnVirtualObject(VO_COMMAND, l9, ACTOR_VEHICLE);
			if(l9.GetNumObjects() > 0)
			{
				Vehicle m = l9.GetObject(0);
				PersonList passengers = m.GetPassengers();
				if (passengers.GetNumPersons() == 0)
				{
					m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 4, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
				}
			}
			GameObjectList 110;
 			Game::CollectObstaclesOnVirtualObject(VO_MEDIC12, l10, ACTOR_VEHICLE);
			if(l10.GetNumObjects() > 0)
			{
				Vehicle m = l10.GetObject(0);
				PersonList passengers = m.GetPassengers();
				if (passengers.GetNumPersons() == 0)
				{
					m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
				}
			}			
		if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2
		{
			Caller->AssignCommand(DUMMY_ALARM);
			Caller->PushActionWait(ACTION_NEWLIST, 1.5f);
			//Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_GATES, Caller, 3, false);
			//Caller->PushActionWait(ACTION_APPEND, 14.0f);
			Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_ALARM, Caller, 1, false);
			GameObjectList l1 = Game::GetGameObjects(NAME_FIRESTATION2);
			for(int i=0; i < l1.GetNumObjects(); i++)
			{
				GameObject *obj = l1.GetObject(i);
				if (!obj->IsSpecialLightEnabled())
				{
					obj->EnableSpecialLights(true);
					Vector AlarmSnd = obj->GetPosition();
					int soundID = Audio::PlaySample3D(SND_ALARM2, AlarmSnd, true);
					obj->SetUserData(soundID);
					obj->AttachSound(soundID);
				}
			}
			GameObjectList l2;
 			Game::CollectObstaclesOnVirtualObject(VO_LADDER3, l2, ACTOR_VEHICLE);
			if(12.GetNumObjects() > 0)
			{
				Vehicle m = l2.GetObject(0);
				PersonList passengers = m.GetPassengers();
				if (passengers.GetNumPersons() == 0)
				{
					m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
				}
			}
			GameObjectList l3;
 			Game::CollectObstaclesOnVirtualObject(VO_FORESTRY3, l3, ACTOR_VEHICLE);
			if(l3.GetNumObjects() > 0)
			{
				Vehicle m = l3.GetObject(0);
				PersonList passengers = m.GetPassengers();
				if (passengers.GetNumPersons() == 0)
				{
					m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 4, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
				}
			}
			GameObjectList l4;
 			Game::CollectObstaclesOnVirtualObject(VO_FOAM4, l4, ACTOR_VEHICLE);
			if(l4.GetNumObjects() > 0)
			{
				Vehicle m = l4.GetObject(0);
				PersonList passengers = m.GetPassengers();
				if (passengers.GetNumPersons() == 0)
				{
					m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 4, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
				}
			}
			GameObjectList l5;
 			Game::CollectObstaclesOnVirtualObject(VO_ENGINE2, l5, ACTOR_VEHICLE);
			if(l5.GetNumObjects() > 0)
			{
				Vehicle m = l5.GetObject(0);
				PersonList passengers = m.GetPassengers();
				if (passengers.GetNumPersons() == 0)
				{
					m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 4, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
				}
			}
			GameObjectList l6;
 			Game::CollectObstaclesOnVirtualObject(VO_ENGINE3, l6, ACTOR_VEHICLE);
			if(l6.GetNumObjects() > 0)
			{
				Vehicle m = l6.GetObject(0);
				PersonList passengers = m.GetPassengers();
				if (passengers.GetNumPersons() == 0)
				{
					m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 4, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
				}
			}
			GameObjectList l7;
 			Game::CollectObstaclesOnVirtualObject(VO_FOAM42, l7, ACTOR_VEHICLE);
			if(l7.GetNumObjects() > 0)
			{
				Vehicle m = l7.GetObject(0);
				PersonList passengers = m.GetPassengers();
				if (passengers.GetNumPersons() == 0)
				{
					m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 4, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
				}
			}
			GameObjectList l8;
 			Game::CollectObstaclesOnVirtualObject(VO_EMS12, l8, ACTOR_VEHICLE);
			if(l8.GetNumObjects() > 0)
			{
				Vehicle m = l8.GetObject(0);
				PersonList passengers = m.GetPassengers();
				if (passengers.GetNumPersons() == 0)
				{
					m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 4, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
				}
			}
			GameObjectList l9;
 			Game::CollectObstaclesOnVirtualObject(VO_MEDIC1, l9, ACTOR_VEHICLE);
			if(l9.GetNumObjects() > 0)
			{
				Vehicle m = l9.GetObject(0);
				PersonList passengers = m.GetPassengers();
				if (passengers.GetNumPersons() == 0)
				{
					m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
				}
			}
			GameObjectList l10;
 			Game::CollectObstaclesOnVirtualObject(VO_MEDIC2, l10, ACTOR_VEHICLE);
			if(l10.GetNumObjects() > 0)
			{
				Vehicle m = l10.GetObject(0);
				PersonList passengers = m.GetPassengers();
				if (passengers.GetNumPersons() == 0)
				{
					m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 4, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
				}
			}
		}
		if(Caller->HasName(NAME_CONTROLPANEL3)) //= RESCUSE STATION
		{
			Caller->AssignCommand(DUMMY_ALARM);
			Caller->PushActionWait(ACTION_NEWLIST, 1.5f);
			//Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_GATES, Caller, 3, false);
			//Caller->PushActionWait(ACTION_APPEND, 14.0f);
			Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_ALARM, Caller, 1, false);
			GameObjectList l1 = Game::GetGameObjects(NAME_FIRESTATION3);
			for(int i=0; i < l1.GetNumObjects(); i++)
			{
				GameObject *obj = l1.GetObject(i);
				if (!obj->IsSpecialLightEnabled())
				{
					obj->EnableSpecialLights(true);
					Vector AlarmSnd = obj->GetPosition();
					int soundID = Audio::PlaySample3D(SND_ALARM3, AlarmSnd, true);
					obj->SetUserData(soundID);
					obj->AttachSound(soundID);
				}
			}
			GameObjectList l2;
 			Game::CollectObstaclesOnVirtualObject(VO_SQUAD3, l2, ACTOR_VEHICLE);
			if(l2.GetNumObjects() > 0)
			{
				Vehicle m = l2.GetObject(0);
				PersonList passengers = m.GetPassengers();
				if (passengers.GetNumPersons() == 0)
				{
					m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 4, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 2, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 2, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 2, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 2, false);
				}
			}
			GameObjectList l3;
 			Game::CollectObstaclesOnVirtualObject(VO_LADDER2, l3, ACTOR_VEHICLE);
			if(l3.GetNumObjects() > 0)
			{
				Vehicle m = l3.GetObject(0);
				PersonList passengers = m.GetPassengers();
				if (passengers.GetNumPersons() == 0)
				{
					m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 4, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 2, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 2, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 2, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 2, false);
				}
			}
			GameObjectList l4;
 			Game::CollectObstaclesOnVirtualObject(VO_BATT12, l4, ACTOR_VEHICLE);
			if(l4.GetNumObjects() > 0)
			{
				Vehicle m = l4.GetObject(0);
				PersonList passengers = m.GetPassengers();
				if (passengers.GetNumPersons() == 0)
				{
					m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 2, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 2, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 2, false);
				}
			}
			GameObjectList l5;
 			Game::CollectObstaclesOnVirtualObject(VO_HAZMAT4, l5, ACTOR_VEHICLE);
			if(l5.GetNumObjects() > 0)
			{
				Vehicle m = l5.GetObject(0);
				PersonList passengers = m.GetPassengers();
				if (passengers.GetNumPersons() == 0)
				{
					m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 5, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 5, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 5, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 5, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 5, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 5, false);
				}
			}
			GameObjectList l6;
 			Game::CollectObstaclesOnVirtualObject(VO_FOAM4, l6, ACTOR_VEHICLE);
			if(l6.GetNumObjects() > 0)
			{
				Vehicle m = l6.GetObject(0);
				PersonList passengers = m.GetPassengers();
				if (passengers.GetNumPersons() == 0)
				{
					m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 6, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 6, false);
				}
			}
			GameObjectList l7;
 			Game::CollectObstaclesOnVirtualObject(VO_CRANE, l7, ACTOR_VEHICLE);
			if(l7.GetNumObjects() > 0)
			{
				Vehicle m = l7.GetObject(0);
				PersonList passengers = m.GetPassengers();
				if (passengers.GetNumPersons() == 0)
				{
					m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 3, false);
					m.PushActionWait(ACTION_APPEND, 0.5f);
					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
				}
			}	
		}
	}
};

/*object VcmdRoof : CommandScript
{
	VcmdRoof()
	{
		SetCursor("roof");
		SetIcon("roof");
	}

	bool CheckPossible(GameObject *Caller)
	{
		if (!Caller->IsValid())
			return false;

		if (!Game::IsFreeplay() && !Game::IsMultiplayer())
			return true;

		return true;
	}

	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
	{
		if (!Caller->IsValid() || !Target->IsValid() || (Caller->GetID() != Target->GetID()))
			return false;

		return true;
	}

	void PushActions(GameObject *Caller, Actor *Target, int ChildID)
	{
		if(Caller->HasName(NAME_CONTROLPANEL)) //= fire station 1
		{
			GameObjectList l1 = Game::GetGameObjects(NAME_FIRESTATION_ROOF);
			for(int i=0; i < l1.GetNumObjects(); i++)
			{
				GameObject *obj = l1.GetObject(i);
				if(obj->GetUserData() == 0)
				{
					obj->Hide(); 
					obj->SetUserData(1);
				} else
				{
					obj->Show(); 
					obj->SetUserData(0);
				} 
			}
		}
		if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2
		{
			GameObjectList l1 = Game::GetGameObjects(NAME_FIRESTATION2_ROOF);
			for(int i=0; i < l1.GetNumObjects(); i++)
			{
				GameObject *obj = l1.GetObject(i);
				if(obj->GetUserData() == 0)
				{
					obj->Hide(); 
					obj->SetUserData(1);
				} else
				{
					obj->Show(); 
					obj->SetUserData(0);
				} 
			}
		}
	}
};*/

/*object VcmdGarageDoorsUp : CommandScript
{
	VcmdGarageDoorsUp()
	{
		SetCursor("garagedoorup");
		SetIcon("garagedoorup");
	}

	bool CheckPossible(GameObject *Caller)
	{
		if (!Caller->IsValid())
			return false;

		if (!Game::IsFreeplay() && !Game::IsMultiplayer())
			return true;

		Vehicle v(Caller);
		if (v.HasCommand(DUMMY_ALARM))
			return false;

		return true;
	}

	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
	{
		if (!Caller->IsValid() || !Target->IsValid() || (Caller->GetID() != Target->GetID()))
			return false;

		return true;
	}

	void PushActions(GameObject *Caller, Actor *Target, int ChildID)
	{
		if(Caller->HasName(NAME_CONTROLPANEL)) //= fire station 1
			Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_GATES, Caller, 1, false);
		else if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2
			Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_GATES, Caller, 3, false);
	}
};*/

/*object VcmdGarageDoorsDown : CommandScript
{
	VcmdGarageDoorsDown()
	{
		SetCursor("garagedoordown");
		SetIcon("garagedoordown");
	}

	bool CheckPossible(GameObject *Caller)
	{
		if (!Caller->IsValid())
			return false;

		if (!Game::IsFreeplay() && !Game::IsMultiplayer())
			return true;

		Vehicle v(Caller);
		if (v.HasCommand(DUMMY_ALARM))
			return false;

		return true;
	}

	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
	{
		if (!Caller->IsValid() || !Target->IsValid() || (Caller->GetID() != Target->GetID()))
			return false;

		return true;
	}

	void PushActions(GameObject *Caller, Actor *Target, int ChildID)
	{
		if(Caller->HasName(NAME_CONTROLPANEL)) //= fire station 1
			Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_GATES, Caller, 2, false);
		else if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2
			Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_GATES, Caller, 4, false);
	}
};*/

object VcmdCallEMT : CommandScript
{
	VcmdCallEMT()
	{
		SetCursor("alarm");
		SetIcon("callemt");
	}

	bool CheckPossible(GameObject *Caller)
	{
		if (!Caller->IsValid())
			return false;

		if (!Game::IsFreeplay() && !Game::IsMultiplayer())
			return true;

		Vehicle v(Caller);
		if (v.HasCommand(DUMMY_ALARM))
			return false;

		return true;
	}

	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
	{
		if (!Caller->IsValid() || !Target->IsValid() || (Caller->GetID() != Target->GetID()))
			return false;

		return true;
	}

	void PushActions(GameObject *Caller, Actor *Target, int ChildID)
	{
		if(Caller->HasName(NAME_CONTROLPANEL)) //= fire station 1
		{
			ActorList l1 = Game::GetActors(VO_SPAWN01);
			ActorList l2 = Game::GetActors(VO_MOVETO01);
		}
		if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2
		{
			ActorList l1 = Game::GetActors(VO_SPAWN02);
			ActorList l2 = Game::GetActors(VO_MOVETO02);
		}
		if(Caller->HasName(NAME_CONTROLPANEL3)) //= RESCUSE STATION
		{
			ActorList l1 = Game::GetActors(VO_SPAWN03);
			ActorList l2 = Game::GetActors(VO_MOVETO03);
		}
		if(l1.GetNumActors() > 0)
			Vector Spawn = l1.GetActor(0)->GetPosition();

		if(l2.GetNumActors() > 0)
			Vector MoveTo = l2.GetActor(0)->GetPosition();
		
		Person p = Game::CreatePerson(OBJ_EMT, UNNAMED);
		if (Game::FindFreePosition(&p, Spawn))
		{
			p.SetUpgradeLevel(3);
			Game::FindFreePosition(&p, Spawn);
			p.SetPosition(Spawn);
			p.PushActionMove(ACTION_NEWLIST, MoveTo);
		}
	}
};

/*object VcmdCallEMTSCBA : CommandScript
{
	VcmdCallEMTSCBA()
	{
		SetCursor("alarm");
		SetIcon("callemtscba");
	}

	bool CheckPossible(GameObject *Caller)
	{
		if (!Caller->IsValid())
			return false;

		if (!Game::IsFreeplay() && !Game::IsMultiplayer())
			return true;

		Vehicle v(Caller);
		if (v.HasCommand(DUMMY_ALARM))
			return false;

		return true;
	}

	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
	{
		if (!Caller->IsValid() || !Target->IsValid() || (Caller->GetID() != Target->GetID()))
			return false;

		return true;
	}

	void PushActions(GameObject *Caller, Actor *Target, int ChildID)
	{
		if(Caller->HasName(NAME_CONTROLPANEL)) //= fire station 1
		{
			ActorList l1 = Game::GetActors(VO_SPAWN01);
			ActorList l2 = Game::GetActors(VO_MOVETO01);
		}
		if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2
		{
			ActorList l1 = Game::GetActors(VO_SPAWN02);
			ActorList l2 = Game::GetActors(VO_MOVETO02);
		}
		if(l1.GetNumActors() > 0)
			Vector Spawn = l1.GetActor(0)->GetPosition();

		if(l2.GetNumActors() > 0)
			Vector MoveTo = l2.GetActor(0)->GetPosition();
		
		Person p = Game::CreatePerson(OBJ_EMT_SCBA, UNNAMED);
		if (Game::FindFreePosition(&p, Spawn))
		{
			p.SetUpgradeLevel(3);
			Game::FindFreePosition(&p, Spawn);
			p.SetPosition(Spawn);
			p.PushActionMove(ACTION_NEWLIST, MoveTo);
		}
	}
};*/

/*object VcmdCallEMTStretcher : CommandScript
{
	VcmdCallEMTStretcher()
	{
		SetCursor("alarm");
		SetIcon("callemtstretcher");
	}

	bool CheckPossible(GameObject *Caller)
	{
		if (!Caller->IsValid())
			return false;

		if (!Game::IsFreeplay() && !Game::IsMultiplayer())
			return true;

		Vehicle v(Caller);
		if (v.HasCommand(DUMMY_ALARM))
			return false;

		return true;
	}

	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
	{
		if (!Caller->IsValid() || !Target->IsValid() || (Caller->GetID() != Target->GetID()))
			return false;

		return true;
	}

	void PushActions(GameObject *Caller, Actor *Target, int ChildID)
	{
		if(Caller->HasName(NAME_CONTROLPANEL)) //= fire station 1
		{
			ActorList l1 = Game::GetActors(VO_SPAWN01);
			ActorList l2 = Game::GetActors(VO_MOVETO01);
		}
		if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2
		{
			ActorList l1 = Game::GetActors(VO_SPAWN03);
			ActorList l2 = Game::GetActors(VO_MOVETO02);
		}
		if(l1.GetNumActors() > 0)
			Vector Spawn = l1.GetActor(0)->GetPosition();

		if(l2.GetNumActors() > 0)
			Vector MoveTo = l2.GetActor(0)->GetPosition();
		
		Person p = Game::CreatePerson(OBJ_EMT_STRETCHER, UNNAMED);
		if (Game::FindFreePosition(&p, Spawn))
		{
			p.SetUpgradeLevel(3);
			Game::FindFreePosition(&p, Spawn);
			p.SetPosition(Spawn);
			//p.SetAutoHealDistance(0.1f);
			p.PushActionMove(ACTION_NEWLIST, MoveTo);
		}
	}
};*/

/*object VcmdCallPM : CommandScript
{
	VcmdCallPM()
	{
		SetCursor("alarm");
		SetIcon("callpm");
	}

	bool CheckPossible(GameObject *Caller)
	{
		if (!Caller->IsValid())
			return false;

		if (!Game::IsFreeplay() && !Game::IsMultiplayer())
			return true;

		Vehicle v(Caller);
		if (v.HasCommand(DUMMY_ALARM))
			return false;

		return true;
	}

	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
	{
		if (!Caller->IsValid() || !Target->IsValid() || (Caller->GetID() != Target->GetID()))
			return false;

		return true;
	}

	void PushActions(GameObject *Caller, Actor *Target, int ChildID)
	{
		if(Caller->HasName(NAME_CONTROLPANEL)) //= fire station 1
		{
			ActorList l1 = Game::GetActors(VO_SPAWN01);
			ActorList l2 = Game::GetActors(VO_MOVETO01);
		}
		if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2
		{
			ActorList l1 = Game::GetActors(VO_SPAWN03);
			ActorList l2 = Game::GetActors(VO_MOVETO02);
		}
		if(l1.GetNumActors() > 0)
			Vector Spawn = l1.GetActor(0)->GetPosition();

		if(l2.GetNumActors() > 0)
			Vector MoveTo = l2.GetActor(0)->GetPosition();
		
		Person p = Game::CreatePerson(OBJ_PM, UNNAMED);
		if (Game::FindFreePosition(&p, Spawn))
		{
			p.SetUpgradeLevel(3);
			Game::FindFreePosition(&p, Spawn);
			p.SetPosition(Spawn);
			p.SetEquipment(EQUIP_EMERGENCY_CASE);
			//p.SetAutoHealDistance(1000.f);
			p.PushActionMove(ACTION_NEWLIST, MoveTo);
		}
	}
};*/

/*object VcmdCallPMSCBA : CommandScript
{
	VcmdCallPMSCBA()
	{
		SetCursor("alarm");
		SetIcon("callpmscba");
	}

	bool CheckPossible(GameObject *Caller)
	{
		if (!Caller->IsValid())
			return false;

		if (!Game::IsFreeplay() && !Game::IsMultiplayer())
			return true;

		Vehicle v(Caller);
		if (v.HasCommand(DUMMY_ALARM))
			return false;

		return true;
	}

	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
	{
		if (!Caller->IsValid() || !Target->IsValid() || (Caller->GetID() != Target->GetID()))
			return false;

		return true;
	}

	void PushActions(GameObject *Caller, Actor *Target, int ChildID)
	{
		if(Caller->HasName(NAME_CONTROLPANEL)) //= fire station 1
		{
			ActorList l1 = Game::GetActors(VO_SPAWN01);
			ActorList l2 = Game::GetActors(VO_MOVETO01);
		}
		if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2
		{
			ActorList l1 = Game::GetActors(VO_SPAWN03);
			ActorList l2 = Game::GetActors(VO_MOVETO02);
		}
		if(l1.GetNumActors() > 0)
			Vector Spawn = l1.GetActor(0)->GetPosition();

		if(l2.GetNumActors() > 0)
			Vector MoveTo = l2.GetActor(0)->GetPosition();
		
		Person p = Game::CreatePerson(OBJ_PM_SCBA, UNNAMED);
		if (Game::FindFreePosition(&p, Spawn))
		{
			p.SetUpgradeLevel(3);
			Game::FindFreePosition(&p, Spawn);
			p.SetPosition(Spawn);
			//p.SetEquipment(EQUIP_EMERGENCY_CASE);
			//p.SetAutoHealDistance(0.1f);
			p.PushActionMove(ACTION_NEWLIST, MoveTo);
		}
	}
};*/

/*object VcmdCallPMStretcher : CommandScript
{
	VcmdCallPMStretcher()
	{
		SetCursor("alarm");
		SetIcon("callpmstretcher");
	}

	bool CheckPossible(GameObject *Caller)
	{
		if (!Caller->IsValid())
			return false;

		if (!Game::IsFreeplay() && !Game::IsMultiplayer())
			return true;

		Vehicle v(Caller);
		if (v.HasCommand(DUMMY_ALARM))
			return false;

		return true;
	}

	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
	{
		if (!Caller->IsValid() || !Target->IsValid() || (Caller->GetID() != Target->GetID()))
			return false;

		return true;
	}

	void PushActions(GameObject *Caller, Actor *Target, int ChildID)
	{
		if(Caller->HasName(NAME_CONTROLPANEL)) //= fire station 1
		{
			ActorList l1 = Game::GetActors(VO_SPAWN01);
			ActorList l2 = Game::GetActors(VO_MOVETO01);
		}
		if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2
		{
			ActorList l1 = Game::GetActors(VO_SPAWN03);
			ActorList l2 = Game::GetActors(VO_MOVETO02);
		}
		if(l1.GetNumActors() > 0)
			Vector Spawn = l1.GetActor(0)->GetPosition();

		if(l2.GetNumActors() > 0)
			Vector MoveTo = l2.GetActor(0)->GetPosition();
				
		Person p = Game::CreatePerson(OBJ_PM_STRETCHER, UNNAMED);
		if (Game::FindFreePosition(&p, Spawn))
		{
			p.SetUpgradeLevel(3);
			Game::FindFreePosition(&p, Spawn);
			p.SetPosition(Spawn);
			//p.SetAutoHealDistance(0.1f);
			p.PushActionMove(ACTION_NEWLIST, MoveTo);
		}
	}
};*/

object VcmdCallUSFS : CommandScript
{
	VcmdCallHazmat()
	{
		SetCursor("alarm");
		SetIcon("callusar");
	}

	bool CheckPossible(GameObject *Caller)
	{
		if (!Caller->IsValid())
			return false;

		if (!Game::IsFreeplay() && !Game::IsMultiplayer())
			return true;

		Vehicle v(Caller);
		if (v.HasCommand(DUMMY_ALARM))
			return false;

		return true;
	}

	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
	{
		if (!Caller->IsValid() || !Target->IsValid() || (Caller->GetID() != Target->GetID()))
			return false;

		return true;
	}

	void PushActions(GameObject *Caller, Actor *Target, int ChildID)
	{
		if(Caller->HasName(NAME_CONTROLPANEL3)) //= RESCUSE STATION
		{
			ActorList l1 = Game::GetActors(VO_SPAWN03);
			ActorList l2 = Game::GetActors(VO_MOVETO03);
		}
		/*if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2
		{
			ActorList l1 = Game::GetActors(VO_SPAWN03);
			ActorList l2 = Game::GetActors(VO_MOVETO02);
		}*/
		if(l1.GetNumActors() > 0)
			Vector Spawn = l1.GetActor(0)->GetPosition();

		if(l2.GetNumActors() > 0)
			Vector MoveTo = l2.GetActor(0)->GetPosition();
				
		Person p = Game::CreatePerson(OBJ_USFS, UNNAMED);
		if (Game::FindFreePosition(&p, Spawn))
		{
			p.SetUpgradeLevel(3);
			p.SetPosition(Spawn);
			p.PushActionMove(ACTION_NEWLIST, MoveTo);
		}
	}
};

object VcmdCallDiver : CommandScript
{
	VcmdCallDiver()
	{
		SetCursor("alarm");
		SetIcon("calldiver");
	}

	bool CheckPossible(GameObject *Caller)
	{
		if (!Caller->IsValid())
			return false;

		if (!Game::IsFreeplay() && !Game::IsMultiplayer())
			return true;

		Vehicle v(Caller);
		if (v.HasCommand(DUMMY_ALARM))
			return false;

		return true;
	}

	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
	{
		if (!Caller->IsValid() || !Target->IsValid() || (Caller->GetID() != Target->GetID()))
			return false;

		return true;
	}

	void PushActions(GameObject *Caller, Actor *Target, int ChildID)
	{
		/*if(Caller->HasName(NAME_CONTROLPANEL)) //= fire station 1
		{
			ActorList l1 = Game::GetActors(VO_SPAWN01);
			ActorList l2 = Game::GetActors(VO_MOVETO01);
		}
		if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2
		{
			ActorList l1 = Game::GetActors(VO_SPAWN02);
			ActorList l2 = Game::GetActors(VO_MOVETO02);
		}*/
		if(Caller->HasName(NAME_CONTROLPANEL3)) //= RESCUSE STATION
		{
			ActorList l1 = Game::GetActors(VO_SPAWN03);
			ActorList l2 = Game::GetActors(VO_MOVETO03);
		}
		if(l1.GetNumActors() > 0)
			Vector Spawn = l1.GetActor(0)->GetPosition();

		if(l2.GetNumActors() > 0)
			Vector MoveTo = l2.GetActor(0)->GetPosition();
				
		Person p = Game::CreatePerson(OBJ_DIVER, UNNAMED);
		if (Game::FindFreePosition(&p, Spawn))
		{
			p.SetUpgradeLevel(3);
			Game::FindFreePosition(&p, Spawn);
			p.SetPosition(Spawn);
			p.PushActionMove(ACTION_NEWLIST, MoveTo);
		}
	}
};

object VcmdCallHazmat : CommandScript
{
	VcmdCallHazmat()
	{
		SetCursor("alarm");
		SetIcon("callhazmat");
	}

	bool CheckPossible(GameObject *Caller)
	{
		if (!Caller->IsValid())
			return false;

		if (!Game::IsFreeplay() && !Game::IsMultiplayer())
			return true;

		Vehicle v(Caller);
		if (v.HasCommand(DUMMY_ALARM))
			return false;

		return true;
	}

	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
	{
		if (!Caller->IsValid() || !Target->IsValid() || (Caller->GetID() != Target->GetID()))
			return false;

		return true;
	}

	void PushActions(GameObject *Caller, Actor *Target, int ChildID)
	{
		if(Caller->HasName(NAME_CONTROLPANEL3)) //= RESCUSE STATION
		{
			ActorList l1 = Game::GetActors(VO_SPAWN03);
			ActorList l2 = Game::GetActors(VO_MOVETO03);
		}
		/*if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2
		{
			ActorList l1 = Game::GetActors(VO_SPAWN03);
			ActorList l2 = Game::GetActors(VO_MOVETO02);
		}*/
		if(l1.GetNumActors() > 0)
			Vector Spawn = l1.GetActor(0)->GetPosition();

		if(l2.GetNumActors() > 0)
			Vector MoveTo = l2.GetActor(0)->GetPosition();
				
		Person p = Game::CreatePerson(OBJ_EMT, UNNAMED);
		if (Game::FindFreePosition(&p, Spawn))
		{
			p.SetUpgradeLevel(3);
			p.SetPosition(Spawn);
			p.PushActionMove(ACTION_NEWLIST, MoveTo);
		}
	}
};

/*object VcmdCallUSARFF : CommandScript
{
	VcmdCallUSARFF()
	{
		SetCursor("alarm");
		SetIcon("callusar");
	}

	bool CheckPossible(GameObject *Caller)
	{
		if (!Caller->IsValid())
			return false;

		if (!Game::IsFreeplay() && !Game::IsMultiplayer())
			return true;

		Vehicle v(Caller);
		if (v.HasCommand(DUMMY_ALARM))
			return false;

		return true;
	}

	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
	{
		if (!Caller->IsValid() || !Target->IsValid() || (Caller->GetID() != Target->GetID()))
			return false;

		return true;
	}

	void PushActions(GameObject *Caller, Actor *Target, int ChildID)
	{
		if(Caller->HasName(NAME_CONTROLPANEL)) //= fire station 1
		{
			ActorList l1 = Game::GetActors(VO_SPAWN01);
			ActorList l2 = Game::GetActors(VO_MOVETO01);
		}
		if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2
		{
			ActorList l1 = Game::GetActors(VO_SPAWN03);
			ActorList l2 = Game::GetActors(VO_MOVETO02);
		}
		if(l1.GetNumActors() > 0)
			Vector Spawn = l1.GetActor(0)->GetPosition();

		if(l2.GetNumActors() > 0)
			Vector MoveTo = l2.GetActor(0)->GetPosition();
				
		Person p = Game::CreatePerson(OBJ_USARFF, UNNAMED);
		if (Game::FindFreePosition(&p, Spawn))
		{
			p.SetUpgradeLevel(3);
			p.SetPosition(Spawn);
			p.PushActionMove(ACTION_NEWLIST, MoveTo);
		}
	}
};*/

object VcmdEmptyFireStation : CommandScript
{
	VcmdEmptyFireStation()
	{
		SetIcon("enterhouse");
		SetCursor("enterhouse");
	}

	bool CheckPossible(GameObject *Caller)
	{
		if (!Caller->IsValid())
			return false;

		if (!Game::IsFreeplay())
			return true;

		return true;
	}

	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
	{
		if (!Caller->IsValid() || !Target->IsValid() || (Caller->GetID() != Target->GetID()))
			return false;

		return true;
	}

	void PushActions(GameObject *Caller, Actor *Target, int ChildID)
	{
		if(Caller->HasName(NAME_CONTROLPANEL)) //= fire station 1
		{
			ActorList l1 = Game::GetActors(VO_SPAWN01);
			if(l1.GetNumActors() > 0)
				Vector Spawn = l1.GetActor(0)->GetPosition();

			GameObjectList l2;
			Game::CollectObstaclesOnVirtualObject(VO_SQUAD01, l2, ACTOR_PERSON);
			for(int i = 0; i < l2.GetNumObjects(); i++)
			{
				GameObject *obj = l2.GetObject(i);
				if (obj->GetType() == ACTOR_PERSON)
				{
					Person p(obj);
					p.PushActionMove(ACTION_NEWLIST, Spawn);
					p.PushActionDeleteOwner(ACTION_APPEND);
				}
			}
		}
		if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2
		{
			ActorList l1 = Game::GetActors(VO_SPAWN02);
			if(l1.GetNumActors() > 0)
				Vector Spawn = l1.GetActor(0)->GetPosition();

			GameObjectList l2;
			Game::CollectObstaclesOnVirtualObject(VO_SQUAD02, l2, ACTOR_PERSON);
			for(int i = 0; i < l2.GetNumObjects(); i++)
			{
				GameObject *obj = l2.GetObject(i);
				if (obj->GetType() == ACTOR_PERSON)
				{
					Person p(obj);
					p.PushActionMove(ACTION_NEWLIST, Spawn);
					p.PushActionDeleteOwner(ACTION_APPEND);
				}
			}
		}
		if(Caller->HasName(NAME_CONTROLPANEL3)) //= RESCUSE STATION
		{
			ActorList l1 = Game::GetActors(VO_SPAWN03);
			if(l1.GetNumActors() > 0)
				Vector Spawn = l1.GetActor(0)->GetPosition();

			GameObjectList l2;
			Game::CollectObstaclesOnVirtualObject(VO_SQUAD03, l2, ACTOR_PERSON);
			for(int i = 0; i < l2.GetNumObjects(); i++)
			{
				GameObject *obj = l2.GetObject(i);
				if (obj->GetType() == ACTOR_PERSON)
				{
					Person p(obj);
					p.PushActionMove(ACTION_NEWLIST, Spawn);
					p.PushActionDeleteOwner(ACTION_APPEND);
				}
			}
		}
	}
};

object DummyDisableAlarm : CommandScript
{
	DummyDisableAlarm()
	{
 		SetGroupID(DummyGroup);
	}

 	bool CheckGroupVisibility(GameObject *Caller)
 	{
 		return false;
 	}
 
 	bool CheckPossible(GameObject *Caller)
 	{
 		return false;
 	} 

	void PushActions(GameObject *Caller, Actor *Target, int ChildID)
	{
		Vehicle v(Caller);
		if (v.HasCommand(DUMMY_ALARM))
			v.RemoveCommand(DUMMY_ALARM);

		if(Caller->HasName(NAME_CONTROLPANEL) || Caller->HasName(NAME_FIRESTATION)) //= fire station 1
			GameObjectList l1 = Game::GetGameObjects(NAME_FIRESTATION);
		else if(Caller->HasName(NAME_CONTROLPANEL2) || Caller->HasName(NAME_FIRESTATION2)) //= fire station 2
			GameObjectList l1 = Game::GetGameObjects(NAME_FIRESTATION2);
		else
			GameObjectList l1 = Game::GetGameObjects(NAME_FIRESTATION3);

		for(int i=0; i < l1.GetNumObjects(); i++)
		{
			GameObject *obj = l1.GetObject(i);
			obj->EnableSpecialLights(false);
			int ref = obj->GetUserData();
			obj->UnattachSound(ref);
			Audio::StopSample(ref);
		}
	}
};

object DummyCallCrew : CommandScript
{
	DummyCallCrew()
	{
 		SetGroupID(DummyGroup);
	}

 	bool CheckGroupVisibility(GameObject *Caller)
 	{
 		return false;
 	}
 
 	bool CheckPossible(GameObject *Caller)
 	{
 		return false;
 	} 

	void PushActions(GameObject *Caller, Actor *Target, int ChildID)
	{
		Vehicle v(Caller);
		if(v.IsCollidingWithVirtualObject(VO_SQUAD01))
		{
			ActorList l1 = Game::GetActors(VO_SPAWN01);
			if(l1.GetNumActors() > 0)
				Vector Spawn = l1.GetActor(0)->GetPosition();

			GameObjectList l2 = Game::GetGameObjects(NAME_FIRESTATION);
			for(int i=0; i < l2.GetNumObjects(); i++)
			{
				GameObject *obj = l2.GetObject(i);
				if (!obj->IsSpecialLightEnabled())
				{
					obj->EnableSpecialLights(true);
					obj->PushActionWait(ACTION_NEWLIST, 16.0f);
					obj->PushActionExecuteCommand(ACTION_APPEND, DUMMY_ALARM, Caller, 1, false);
					Vector AlarmSnd = obj->GetPosition();
					int soundID = Audio::PlaySample3D(SND_ALARM, AlarmSnd, true);
					obj->SetUserData(soundID);
					obj->AttachSound(soundID);
				}
			}
		}
		else if(v.IsCollidingWithVirtualObject(VO_SQUAD02))
		{
			ActorList l1 = Game::GetActors(VO_SPAWN02);
			if(l1.GetNumActors() > 0)
				Vector Spawn = l1.GetActor(0)->GetPosition();

			GameObjectList l2 = Game::GetGameObjects(NAME_FIRESTATION2);
			for(int i=0; i < l2.GetNumObjects(); i++)
			{
				GameObject *obj = l2.GetObject(i);
				if (!obj->IsSpecialLightEnabled())
				{
					obj->EnableSpecialLights(true);
					obj->PushActionWait(ACTION_NEWLIST, 16.0f);
					obj->PushActionExecuteCommand(ACTION_APPEND, DUMMY_ALARM, Caller, 1, false);
					Vector AlarmSnd = obj->GetPosition();
					int soundID = Audio::PlaySample3D(SND_ALARM, AlarmSnd, true);
					obj->SetUserData(soundID);
					obj->AttachSound(soundID);
				}
			}
		}
		else
		{
			ActorList l1 = Game::GetActors(VO_SPAWN03);
			if(l1.GetNumActors() > 0)
				Vector Spawn = l1.GetActor(0)->GetPosition();
			GameObjectList l2 = Game::GetGameObjects(NAME_FIRESTATION3);
			for(int i=0; i < l2.GetNumObjects(); i++)
			{
				GameObject *obj = l2.GetObject(i);
				if (!obj->IsSpecialLightEnabled())
				{
					obj->EnableSpecialLights(true);
					obj->PushActionWait(ACTION_NEWLIST, 16.0f);
					obj->PushActionExecuteCommand(ACTION_APPEND, DUMMY_ALARM, Caller, 1, false);
					Vector AlarmSnd = obj->GetPosition();
					int soundID = Audio::PlaySample3D(SND_ALARM, AlarmSnd, true);
					obj->SetUserData(soundID);
					obj->AttachSound(soundID);
				}
			}
		}
		

		PersonList passengers = v.GetPassengers();
		if (ChildID == 1)
		{
			Person p = Game::CreatePerson(OBJ_PM, UNNAMED);
			p.SetEquipment(EQUIP_EMERGENCY_CASE);
		}
		else if (ChildID == 2)
			Person p = Game::CreatePerson(OBJ_USFS, UNNAMED);
		else if (ChildID == 3)
			Person p = Game::CreatePerson(OBJ_EMT, UNNAMED);
		else if (ChildID == 4)
			Person p = Game::CreatePerson(OBJ_CHIEF, UNNAMED);
		else if (ChildID == 5)
			Person p = Game::CreatePerson(OBJ_HAZMAT, UNNAMED);
		else if (ChildID == 6)
			Person p = Game::CreatePerson(OBJ_DIVER, UNNAMED);
		else
			return;

		p.SetUpgradeLevel(3);
		Game::FindFreePosition(&p, Spawn, 250);
		p.SetPosition(Spawn);
		p.PushActionMove(ACTION_NEWLIST, &v, TARGET_ANY);
		p.PushActionTurnTo(ACTION_APPEND, &v);
		p.PushActionEnterCar(ACTION_APPEND, &v);
	}
};

/*object DummyGates : CommandScript
{
	DummyGates()
	{
 		SetGroupID(DummyGroup);
	}

 	bool CheckGroupVisibility(GameObject *Caller)
 	{
 		return false;
 	}
 
 	bool CheckPossible(GameObject *Caller)
 	{
 		return false;
 	} 

	void PushActions(GameObject *Caller, Actor *Target, int ChildID)
	{
		GameObjectList gate01a = Game::GetGameObjects(NAME_GATE01A);
		GameObjectList gate02a = Game::GetGameObjects(NAME_GATE02A);
		GameObjectList gate03a = Game::GetGameObjects(NAME_GATE03A);
		GameObjectList gate04a = Game::GetGameObjects(NAME_GATE04A);
		GameObjectList gate05a = Game::GetGameObjects(NAME_GATE05A);
		GameObjectList gate06a = Game::GetGameObjects(NAME_GATE06A);
		GameObjectList gate07a = Game::GetGameObjects(NAME_GATE07A);
		GameObjectList gate08a = Game::GetGameObjects(NAME_GATE08A);
		GameObjectList gate01b = Game::GetGameObjects(NAME_GATE01B);
		GameObjectList gate02b = Game::GetGameObjects(NAME_GATE02B);
		GameObjectList gate03b = Game::GetGameObjects(NAME_GATE03B);
		GameObjectList gate04b = Game::GetGameObjects(NAME_GATE04B);
		GameObjectList gate05b = Game::GetGameObjects(NAME_GATE05B); 
		GameObjectList gate06b = Game::GetGameObjects(NAME_GATE06B);
		GameObjectList gate07b = Game::GetGameObjects(NAME_GATE07B);
		GameObjectList gate08b = Game::GetGameObjects(NAME_GATE08B); 
		ActorList vogate01a = Game::GetActors(VO_GATE01A); 
		ActorList vogate02a = Game::GetActors(VO_GATE02A);
		ActorList vogate03a = Game::GetActors(VO_GATE03A); 
		ActorList vogate04a = Game::GetActors(VO_GATE04A);
		ActorList vogate05a = Game::GetActors(VO_GATE05A); 
		ActorList vogate06a = Game::GetActors(VO_GATE06A); 
		ActorList vogate07a = Game::GetActors(VO_GATE07A);
		ActorList vogate08a = Game::GetActors(VO_GATE08A); 
 		ActorList vogate01b = Game::GetActors(VO_GATE01B);
		ActorList vogate02b = Game::GetActors(VO_GATE02B);
		ActorList vogate03b = Game::GetActors(VO_GATE03B);
		ActorList vogate04b = Game::GetActors(VO_GATE04B);
		ActorList vogate05b = Game::GetActors(VO_GATE05B);
		ActorList vogate06b = Game::GetActors(VO_GATE06B);
		ActorList vogate07b = Game::GetActors(VO_GATE07B);
		ActorList vogate08b = Game::GetActors(VO_GATE08B);

		if(ChildID == 1) //= Open front gates fire station 1
		{
			for(int i=0; i < gate01a.GetNumObjects(); i++)
			{
				GameObject *gate = gate01a.GetObject(i);
				Actor *vogate = vogate01a.GetActor(i);
				if (gate->GetUserData() == 0)
				{ 
					gate->SetUserData(1);
					gate->SetAnimation(ANI_OPEN);
					vogate->SetVirtualObjectTerrain(VOSET_ROAD);
				}
			}
			for(int i=0; i < gate02a.GetNumObjects(); i++)
			{
				GameObject *gate = gate02a.GetObject(i);
				Actor *vogate = vogate02a.GetActor(i);
				if (gate->GetUserData() == 0)
				{ 
					gate->SetUserData(1);
					gate->SetAnimation(ANI_OPEN);
					vogate->SetVirtualObjectTerrain(VOSET_ROAD);
				}
			}
			for(int i=0; i < gate03a.GetNumObjects(); i++)
			{
				GameObject *gate = gate03a.GetObject(i);
				Actor *vogate = vogate03a.GetActor(i);
				Vector GateSnd = gate->GetPosition();
				if (gate->GetUserData() == 0)
				{ 
					gate->SetUserData(1);
					gate->SetAnimation(ANI_OPEN);
					vogate->SetVirtualObjectTerrain(VOSET_ROAD);
					Audio::PlaySample3D(SND_GATE, GateSnd);
				}
			}
			for(int i=0; i < gate04a.GetNumObjects(); i++)
			{
				GameObject *gate = gate04a.GetObject(i);
				Actor *vogate = vogate04a.GetActor(i);
				if (gate->GetUserData() == 0)
				{ 
					gate->SetUserData(1);
					gate->SetAnimation(ANI_OPEN);
					vogate->SetVirtualObjectTerrain(VOSET_ROAD);
				}
			}
			for(int i=0; i < gate05a.GetNumObjects(); i++)
			{
				GameObject *gate = gate05a.GetObject(i);
				Actor *vogate = vogate05a.GetActor(i);
				if (gate->GetUserData() == 0)
				{ 
					gate->SetUserData(1);
					gate->SetAnimation(ANI_OPEN);
					vogate->SetVirtualObjectTerrain(VOSET_ROAD);
				}
			}
		}
		if(ChildID == 2) //= Close all opened gates fire station 1
		{
			for(int i=0; i < gate01a.GetNumObjects(); i++)
			{
				GameObject *gate = gate01a.GetObject(i);
				Actor *vogate = vogate01a.GetActor(i);
				if (gate->GetUserData() == 1)
				{ 
					gate->SetUserData(0);
					gate->SetAnimation(ANI_CLOSE);
					vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);
				}
			}
			for(int i=0; i < gate02a.GetNumObjects(); i++)
			{
				GameObject *gate = gate02a.GetObject(i);
				Actor *vogate = vogate02a.GetActor(i);
				if (gate->GetUserData() == 1)
				{ 
					gate->SetUserData(0);
					gate->SetAnimation(ANI_CLOSE);
					vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);
				}
			}
			for(int i=0; i < gate03a.GetNumObjects(); i++)
			{
				GameObject *gate = gate03a.GetObject(i);
				Actor *vogate = vogate03a.GetActor(i);
				Vector GateSnd = gate->GetPosition();
				if (gate->GetUserData() == 1)
				{ 
					gate->SetUserData(0);
					gate->SetAnimation(ANI_CLOSE);
					vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);
					Audio::PlaySample3D(SND_GATE, GateSnd);
				}
			}
			for(int i=0; i < gate04a.GetNumObjects(); i++)
			{
				GameObject *gate = gate04a.GetObject(i);
				Actor *vogate = vogate04a.GetActor(i);
				if (gate->GetUserData() == 1)
				{ 
					gate->SetUserData(0);
					gate->SetAnimation(ANI_CLOSE);
					vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);
				}
			}
			for(int i=0; i < gate05a.GetNumObjects(); i++)
			{
				GameObject *gate = gate05a.GetObject(i);
				Actor *vogate = vogate05a.GetActor(i);
				if (gate->GetUserData() == 1)
				{ 
					gate->SetUserData(0);
					gate->SetAnimation(ANI_CLOSE);
					vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);
				}
			}
			for(int i=0; i < gate01b.GetNumObjects(); i++)
			{
				GameObject *gate = gate01b.GetObject(i);
				Actor *vogate = vogate01b.GetActor(i);
				if (gate->GetUserData() == 1)
				{ 
					gate->SetUserData(0);
					gate->SetAnimation(ANI_CLOSE);
					vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);
				}
			}
			for(int i=0; i < gate02b.GetNumObjects(); i++)
			{
				GameObject *gate = gate02b.GetObject(i);
				Actor *vogate = vogate02b.GetActor(i);
				if (gate->GetUserData() == 1)
				{ 
					gate->SetUserData(0);
					gate->SetAnimation(ANI_CLOSE);
					vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);
				}
			}
			for(int i=0; i < gate03b.GetNumObjects(); i++)
			{
				GameObject *gate = gate03b.GetObject(i);
				Actor *vogate = vogate03b.GetActor(i);
				Vector GateSnd = gate->GetPosition();
				if (gate->GetUserData() == 1)
				{ 
					gate->SetUserData(0);
					gate->SetAnimation(ANI_CLOSE);
					vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);
					Audio::PlaySample3D(SND_GATE, GateSnd);
				}
			}
			for(int i=0; i < gate04b.GetNumObjects(); i++)
			{
				GameObject *gate = gate04b.GetObject(i);
				Actor *vogate = vogate04b.GetActor(i);
				if (gate->GetUserData() == 1)
				{ 
					gate->SetUserData(0);
					gate->SetAnimation(ANI_CLOSE);
					vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);
				}
			}
			for(int i=0; i < gate05b.GetNumObjects(); i++)
			{
				GameObject *gate = gate05b.GetObject(i);
				Actor *vogate = vogate05b.GetActor(i);
				if (gate->GetUserData() == 1)
				{ 
					gate->SetUserData(0);
					gate->SetAnimation(ANI_CLOSE);
					vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);
				}
			}
		}
		if(ChildID == 3) //= Open front gates fire station 2
		{
			for(int i=0; i < gate06a.GetNumObjects(); i++)
			{
				GameObject *gate = gate06a.GetObject(i);
				Actor *vogate = vogate06a.GetActor(i);
				if (gate->GetUserData() == 0)
				{ 
					gate->SetUserData(1);
					gate->SetAnimation(ANI_OPEN);
					vogate->SetVirtualObjectTerrain(VOSET_ROAD);
				}
			}
			for(int i=0; i < gate07a.GetNumObjects(); i++)
			{
				GameObject *gate = gate07a.GetObject(i);
				Actor *vogate = vogate07a.GetActor(i);
				if (gate->GetUserData() == 0)
				{ 
					gate->SetUserData(1);
					gate->SetAnimation(ANI_OPEN);
					vogate->SetVirtualObjectTerrain(VOSET_ROAD);
				}
			}
			for(int i=0; i < gate08a.GetNumObjects(); i++)
			{
				GameObject *gate = gate08a.GetObject(i);
				Actor *vogate = vogate08a.GetActor(i);
				Vector GateSnd = gate->GetPosition();
				if (gate->GetUserData() == 0)
				{ 
					gate->SetUserData(1);
					gate->SetAnimation(ANI_OPEN);
					vogate->SetVirtualObjectTerrain(VOSET_ROAD);
					Audio::PlaySample3D(SND_GATE, GateSnd);
				}
			}
		}
		if(ChildID == 4) //= Close all opened gates fire station 2
		{
			for(int i=0; i < gate06a.GetNumObjects(); i++)
			{
				GameObject *gate = gate06a.GetObject(i);
				Actor *vogate = vogate06a.GetActor(i);
				if (gate->GetUserData() == 1)
				{ 
					gate->SetUserData(0);
					gate->SetAnimation(ANI_CLOSE);
					vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);
				}
			}
			for(int i=0; i < gate07a.GetNumObjects(); i++)
			{
				GameObject *gate = gate07a.GetObject(i);
				Actor *vogate = vogate07a.GetActor(i);
				if (gate->GetUserData() == 1)
				{ 
					gate->SetUserData(0);
					gate->SetAnimation(ANI_CLOSE);
					vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);
				}
			}
			for(int i=0; i < gate08a.GetNumObjects(); i++)
			{
				GameObject *gate = gate08a.GetObject(i);
				Actor *vogate = vogate08a.GetActor(i);
				Vector GateSnd = gate->GetPosition();
				if (gate->GetUserData() == 1)
				{ 
					gate->SetUserData(0);
					gate->SetAnimation(ANI_CLOSE);
					vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);
					Audio::PlaySample3D(SND_GATE, GateSnd);
				}
			}
			for(int i=0; i < gate06b.GetNumObjects(); i++)
			{
				GameObject *gate = gate06b.GetObject(i);
				Actor *vogate = vogate06b.GetActor(i);
				if (gate->GetUserData() == 1)
				{ 
					gate->SetUserData(0);
					gate->SetAnimation(ANI_CLOSE);
					vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);
				}
			}
			for(int i=0; i < gate07b.GetNumObjects(); i++)
			{
				GameObject *gate = gate07b.GetObject(i);
				Actor *vogate = vogate07b.GetActor(i);
				if (gate->GetUserData() == 1)
				{ 
					gate->SetUserData(0);
					gate->SetAnimation(ANI_CLOSE);
					vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);
				}
			}
			for(int i=0; i < gate08b.GetNumObjects(); i++)
			{
				GameObject *gate = gate08b.GetObject(i);
				Actor *vogate = vogate08b.GetActor(i);
				Vector GateSnd = gate->GetPosition();
				if (gate->GetUserData() == 1)
				{ 
					gate->SetUserData(0);
					gate->SetAnimation(ANI_CLOSE);
					vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);
					Audio::PlaySample3D(SND_GATE, GateSnd);
				}
			}
		}
		if(ChildID == 5) //= Battalion chief 'calls vehicle cmds' for opening/closing front gates fire station 1
		{
			Vehicle v(Caller);
			if (v.GetVehicleType() == VT_AMBULANCE_RTW) 
			{
				for(int i=0; i < gate01a.GetNumObjects(); i++)
				{
					GameObject *gate = gate01a.GetObject(i);
					Actor *vogate = vogate01a.GetActor(i);
					Vector GateSnd = gate->GetPosition();
					if (gate->GetUserData() == 0)
					{
						gate->SetUserData(1);
						gate->SetAnimation(ANI_OPEN);
						vogate->SetVirtualObjectTerrain(VOSET_ROAD);
						Audio::PlaySample3D(SND_GATE, GateSnd);
					} else
					{
						gate->SetUserData(0);
						gate->SetAnimation(ANI_CLOSE);
						vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);
						Audio::PlaySample3D(SND_GATE, GateSnd);
					}
				}
			}
			if(StrCompare(v.GetPrototypeFileName(), OBJ_USAR) == 0)
			{
				for(int i=0; i < gate02a.GetNumObjects(); i++)
				{
					GameObject *gate = gate02a.GetObject(i);
					Actor *vogate = vogate02a.GetActor(i);
					Vector GateSnd = gate->GetPosition();
					if (gate->GetUserData() == 0)
					{
						gate->SetUserData(1);
						gate->SetAnimation(ANI_OPEN);
						vogate->SetVirtualObjectTerrain(VOSET_ROAD);
						Audio::PlaySample3D(SND_GATE, GateSnd);
					} else
					{
						gate->SetUserData(0);
						gate->SetAnimation(ANI_CLOSE);
						vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);
						Audio::PlaySample3D(SND_GATE, GateSnd);
					}
				}
			}
			if(StrCompare(v.GetPrototypeFileName(), OBJ_TILLER) == 0)
			{
				for(int i=0; i < gate03a.GetNumObjects(); i++)
				{
					GameObject *gate = gate03a.GetObject(i);
					Actor *vogate = vogate03a.GetActor(i);
					Vector GateSnd = gate->GetPosition();
					if (gate->GetUserData() == 0)
					{
						gate->SetUserData(1);
						gate->SetAnimation(ANI_OPEN);
						vogate->SetVirtualObjectTerrain(VOSET_ROAD);
						Audio::PlaySample3D(SND_GATE, GateSnd);
					} else
					{
						gate->SetUserData(0);
						gate->SetAnimation(ANI_CLOSE);
						vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);
						Audio::PlaySample3D(SND_GATE, GateSnd);
					}
				}
			}
			if(StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE01) == 0)
			{
				for(int i=0; i < gate05a.GetNumObjects(); i++)
				{
					GameObject *gate = gate05a.GetObject(i);
					Actor *vogate = vogate05a.GetActor(i);
					Vector GateSnd = gate->GetPosition();
					if (gate->GetUserData() == 0)
					{
						gate->SetUserData(1);
						gate->SetAnimation(ANI_OPEN);
						vogate->SetVirtualObjectTerrain(VOSET_ROAD);
						Audio::PlaySample3D(SND_GATE, GateSnd);
					} else
					{
						gate->SetUserData(0);
						gate->SetAnimation(ANI_CLOSE);
						vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);
						Audio::PlaySample3D(SND_GATE, GateSnd);
					}
				}	
			}
			if(StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE02) == 0 || StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE04) == 0)
			{
				for(int i=0; i < gate04a.GetNumObjects(); i++)
				{
					GameObject *gate = gate04a.GetObject(i);
					Actor *vogate = vogate04a.GetActor(i);
					Vector GateSnd = gate->GetPosition();
					if (gate->GetUserData() == 0)
					{
						gate->SetUserData(1);
						gate->SetAnimation(ANI_OPEN);
						vogate->SetVirtualObjectTerrain(VOSET_ROAD);
						Audio::PlaySample3D(SND_GATE, GateSnd);
					} else
					{
						gate->SetUserData(0);
						gate->SetAnimation(ANI_CLOSE);
						vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);
						Audio::PlaySample3D(SND_GATE, GateSnd);
					}
				}
			}
		}
		if(ChildID == 6) //= Battalion chief 'calls vehicle cmds' for opening/closing front gates fire station 2
		{
			Vehicle v(Caller);
			if(StrCompare(v.GetPrototypeFileName(), OBJ_LADDER) == 0)
			{
				for(int i=0; i < gate06a.GetNumObjects(); i++)
				{
					GameObject *gate = gate06a.GetObject(i);
					Actor *vogate = vogate06a.GetActor(i);
					Vector GateSnd = gate->GetPosition();
					if (gate->GetUserData() == 0)
					{
						gate->SetUserData(1);
						gate->SetAnimation(ANI_OPEN);
						vogate->SetVirtualObjectTerrain(VOSET_ROAD);
						Audio::PlaySample3D(SND_GATE, GateSnd);
					} else
					{
						gate->SetUserData(0);
						gate->SetAnimation(ANI_CLOSE);
						vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);
						Audio::PlaySample3D(SND_GATE, GateSnd);
					}
				}
			}
			if(StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE05) == 0)
			{
				for(int i=0; i < gate07a.GetNumObjects(); i++)
				{
					GameObject *gate = gate07a.GetObject(i);
					Actor *vogate = vogate07a.GetActor(i);
					Vector GateSnd = gate->GetPosition();
					if (gate->GetUserData() == 0)
					{
						gate->SetUserData(1);
						gate->SetAnimation(ANI_OPEN);
						vogate->SetVirtualObjectTerrain(VOSET_ROAD);
						Audio::PlaySample3D(SND_GATE, GateSnd);
					} else
					{
						gate->SetUserData(0);
						gate->SetAnimation(ANI_CLOSE);
						vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);
						Audio::PlaySample3D(SND_GATE, GateSnd);
					}
				}	
			}
			if (v.GetVehicleType() == VT_AMBULANCE_RTW) 
			{
				for(int i=0; i < gate08a.GetNumObjects(); i++)
				{
					GameObject *gate = gate08a.GetObject(i);
					Actor *vogate = vogate08a.GetActor(i);
					Vector GateSnd = gate->GetPosition();
					if (gate->GetUserData() == 0)
					{
						gate->SetUserData(1);
						gate->SetAnimation(ANI_OPEN);
						vogate->SetVirtualObjectTerrain(VOSET_ROAD);
						Audio::PlaySample3D(SND_GATE, GateSnd);
					} else
					{
						gate->SetUserData(0);
						gate->SetAnimation(ANI_CLOSE);
						vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);
						Audio::PlaySample3D(SND_GATE, GateSnd);
					}
				}
			}

		}
		if(ChildID == 7) //To fire station cmd to open rear gates fire station 1
		{
			Vehicle v(Caller);
			if (v.GetVehicleType() == VT_AMBULANCE_RTW) 
			{
				for(int i=0; i < gate01b.GetNumObjects(); i++)
				{
					GameObject *gate = gate01b.GetObject(i);
					Actor *vogate = vogate01b.GetActor(i);
					Vector GateSnd = gate->GetPosition();
					if (gate->GetUserData() == 0)
					{
						gate->SetUserData(1);
						gate->SetAnimation(ANI_OPEN);
						vogate->SetVirtualObjectTerrain(VOSET_ROAD);
						Audio::PlaySample3D(SND_GATE, GateSnd);
					}
				}
			}
			if(StrCompare(v.GetPrototypeFileName(), OBJ_USAR) == 0)
			{
				for(int i=0; i < gate02b.GetNumObjects(); i++)
				{
					GameObject *gate = gate02b.GetObject(i);
					Actor *vogate = vogate02b.GetActor(i);
					Vector GateSnd = gate->GetPosition();
					if (gate->GetUserData() == 0)
					{
						gate->SetUserData(1);
						gate->SetAnimation(ANI_OPEN);
						vogate->SetVirtualObjectTerrain(VOSET_ROAD);
						Audio::PlaySample3D(SND_GATE, GateSnd);
					}
				}
			}
			if(StrCompare(v.GetPrototypeFileName(), OBJ_TILLER) == 0)
			{
				for(int i=0; i < gate03b.GetNumObjects(); i++)
				{
					GameObject *gate = gate03b.GetObject(i);
					Actor *vogate = vogate03b.GetActor(i);
					Vector GateSnd = gate->GetPosition();
					if (gate->GetUserData() == 0)
					{
						gate->SetUserData(1);
						gate->SetAnimation(ANI_OPEN);
						vogate->SetVirtualObjectTerrain(VOSET_ROAD);
						Audio::PlaySample3D(SND_GATE, GateSnd);
					}
				}
			}
			if(StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE01) == 0)
			{
				for(int i=0; i < gate05b.GetNumObjects(); i++)
				{
					GameObject *gate = gate05b.GetObject(i);
					Actor *vogate = vogate05b.GetActor(i);
					Vector GateSnd = gate->GetPosition();
					if (gate->GetUserData() == 0)
					{
						gate->SetUserData(1);
						gate->SetAnimation(ANI_OPEN);
						vogate->SetVirtualObjectTerrain(VOSET_ROAD);
						Audio::PlaySample3D(SND_GATE, GateSnd);
					}
				}	
			}
			if(StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE02) == 0)
			{
				for(int i=0; i < gate04b.GetNumObjects(); i++)
				{
					GameObject *gate = gate04b.GetObject(i);
					Actor *vogate = vogate04b.GetActor(i);
					Vector GateSnd = gate->GetPosition();
					if (gate->GetUserData() == 0)
					{
						gate->SetUserData(1);
						gate->SetAnimation(ANI_OPEN);
						vogate->SetVirtualObjectTerrain(VOSET_ROAD);
						Audio::PlaySample3D(SND_GATE, GateSnd);
					}
				}
			}
		}
		if(ChildID == 8) //To fire station cmd to open rear gates fire station 2
		{
			Vehicle v(Caller);
			if(StrCompare(v.GetPrototypeFileName(), OBJ_LADDER) == 0)
			{
				for(int i=0; i < gate06b.GetNumObjects(); i++)
				{
					GameObject *gate = gate06b.GetObject(i);
					Actor *vogate = vogate06b.GetActor(i);
					Vector GateSnd = gate->GetPosition();
					if (gate->GetUserData() == 0)
					{
						gate->SetUserData(1);
						gate->SetAnimation(ANI_OPEN);
						vogate->SetVirtualObjectTerrain(VOSET_ROAD);
						Audio::PlaySample3D(SND_GATE, GateSnd);
					}
				}
			}
			if(StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE05) == 0)
			{
				for(int i=0; i < gate07b.GetNumObjects(); i++)
				{
					GameObject *gate = gate07b.GetObject(i);
					Actor *vogate = vogate07b.GetActor(i);
					Vector GateSnd = gate->GetPosition();
					if (gate->GetUserData() == 0)
					{
						gate->SetUserData(1);
						gate->SetAnimation(ANI_OPEN);
						vogate->SetVirtualObjectTerrain(VOSET_ROAD);
						Audio::PlaySample3D(SND_GATE, GateSnd);
					}
				}	
			}
			if (v.GetVehicleType() == VT_AMBULANCE_RTW) 
			{
				for(int i=0; i < gate08b.GetNumObjects(); i++)
				{
					GameObject *gate = gate08b.GetObject(i);
					Actor *vogate = vogate08b.GetActor(i);
					Vector GateSnd = gate->GetPosition();
					if (gate->GetUserData() == 0)
					{
						gate->SetUserData(1);
						gate->SetAnimation(ANI_OPEN);
						vogate->SetVirtualObjectTerrain(VOSET_ROAD);
						Audio::PlaySample3D(SND_GATE, GateSnd);
					}
				}
			}
		}
		if(ChildID == 9) //To fire station cmd to close rear gates fire station 1
		{
			Vehicle v(Caller);
			if (v.GetVehicleType() == VT_AMBULANCE_RTW) 
			{
				for(int i=0; i < gate01b.GetNumObjects(); i++)
				{
					GameObject *gate = gate01b.GetObject(i);
					Actor *vogate = vogate01b.GetActor(i);
					Vector GateSnd = gate->GetPosition();
					if (gate->GetUserData() == 1)
					{
						gate->SetUserData(0);
						gate->SetAnimation(ANI_CLOSE);
						vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);
						Audio::PlaySample3D(SND_GATE, GateSnd);
					}
				}
			}
			if(StrCompare(v.GetPrototypeFileName(), OBJ_USAR) == 0)
			{
				for(int i=0; i < gate02b.GetNumObjects(); i++)
				{
					GameObject *gate = gate02b.GetObject(i);
					Actor *vogate = vogate02b.GetActor(i);
					Vector GateSnd = gate->GetPosition();
					if (gate->GetUserData() == 1)
					{
						gate->SetUserData(0);
						gate->SetAnimation(ANI_CLOSE);
						vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);
						Audio::PlaySample3D(SND_GATE, GateSnd);
					}
				}
			}
			if(StrCompare(v.GetPrototypeFileName(), OBJ_TILLER) == 0)
			{
				for(int i=0; i < gate03b.GetNumObjects(); i++)
				{
					GameObject *gate = gate03b.GetObject(i);
					Actor *vogate = vogate03b.GetActor(i);
					Vector GateSnd = gate->GetPosition();
					if (gate->GetUserData() == 1)
					{
						gate->SetUserData(0);
						gate->SetAnimation(ANI_CLOSE);
						vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);
						Audio::PlaySample3D(SND_GATE, GateSnd);
					}
				}
			}
			if(StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE01) == 0)
			{
				for(int i=0; i < gate05b.GetNumObjects(); i++)
				{
					GameObject *gate = gate05b.GetObject(i);
					Actor *vogate = vogate05b.GetActor(i);
					Vector GateSnd = gate->GetPosition();
					if (gate->GetUserData() == 1)
					{
						gate->SetUserData(0);
						gate->SetAnimation(ANI_CLOSE);
						vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);
						Audio::PlaySample3D(SND_GATE, GateSnd);
					}
				}
			}
			if(StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE02) == 0)
			{
				for(int i=0; i < gate04b.GetNumObjects(); i++)
				{
					GameObject *gate = gate04b.GetObject(i);
					Actor *vogate = vogate04b.GetActor(i);
					Vector GateSnd = gate->GetPosition();
					if (gate->GetUserData() == 1)
					{
						gate->SetUserData(0);
						gate->SetAnimation(ANI_CLOSE);
						vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);
						Audio::PlaySample3D(SND_GATE, GateSnd);
					}
				}
			}
		}
		if(ChildID == 10) //To fire station cmd to close rear gates fire station 2
		{
			Vehicle v(Caller);
			if(StrCompare(v.GetPrototypeFileName(), OBJ_LADDER) == 0)
			{
				for(int i=0; i < gate06b.GetNumObjects(); i++)
				{
					GameObject *gate = gate06b.GetObject(i);
					Actor *vogate = vogate06b.GetActor(i);
					Vector GateSnd = gate->GetPosition();
					if (gate->GetUserData() == 1)
					{
						gate->SetUserData(0);
						gate->SetAnimation(ANI_CLOSE);
						vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);
						Audio::PlaySample3D(SND_GATE, GateSnd);
					}
				}
			}
			if(StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE05) == 0)
			{
				for(int i=0; i < gate07b.GetNumObjects(); i++)
				{
					GameObject *gate = gate07b.GetObject(i);
					Actor *vogate = vogate07b.GetActor(i);
					Vector GateSnd = gate->GetPosition();
					if (gate->GetUserData() == 1)
					{
						gate->SetUserData(0);
						gate->SetAnimation(ANI_CLOSE);
						vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);
						Audio::PlaySample3D(SND_GATE, GateSnd);
					}
				}
			}
			if (v.GetVehicleType() == VT_AMBULANCE_RTW) 
			{
				for(int i=0; i < gate08b.GetNumObjects(); i++)
				{
					GameObject *gate = gate08b.GetObject(i);
					Actor *vogate = vogate08b.GetActor(i);
					Vector GateSnd = gate->GetPosition();
					if (gate->GetUserData() == 1)
					{
						gate->SetUserData(0);
						gate->SetAnimation(ANI_CLOSE);
						vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);
						Audio::PlaySample3D(SND_GATE, GateSnd);
					}
				}
			}
		}
	}
};*/

 

Link to comment
Share on other sites

When posting script files, please don't throw them in a CODE box on the forum unless its reasonably short. 2000+ lines requires a LOT of scrolling. Use http://pastebin.com/

 

I found one thing:

Line:  387

if(12.GetNumObjects() > 0)

it's written 12.GetNumObjects() with a "one" when I'm almost positive you meant to put l2.GetNumObjects() with a lowercase "L". In text editor fonts, "1" and "l" look very similar.  Since variables cannot start with a number the script freaked out. The only other thing I know causes that error is if you are missing a curly brace, which I don't think is the case here.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...