Jump to content
cops

ambulance say that they won't belong to the station

Recommended Posts

Hallo,

 

I am currently helping a friend by scripting a part for his mod, how ever... I got a small script problem

The ambulance I placed for the station won't return to there VO... They do spawn there and I don't get a script error or something similar

Only when I send the ambulance to a call and I want to let them return to the station it says "This vehicle don't belong to the station"

 

Can someone help me with this? 

 

it goes about 

VO_Ambulance01

VO_Ambulance02

VO_Ambulance03

 

both of the original units are replaced by AMBULANCE1

and for the second firestation the ambulance has been replaced by ALS1

In the spoiler you can find: 
LAFirestation
LAToFirestation

LAFirestationStart

 

 

 

//******************************************************************************************// #Version 1.5#////  Includes: All command for the fire station.//// - VcmdAlarm// - VcmdRoof// - VcmdGarageDoorsUp// - VcmdGarageDoorsDown// - VcmdCallEMT// - VcmdCallEMTSCBA// - VcmdCallEMTStretcher// - VcmdCallPM// - VcmdCallPMSCBA// - VcmdCallPMStretcher// - VcmdCallDiver// - VcmdCallHazmat// - VcmdCallUSARFF// - VcmdEmptyFireStation// - DummyDisableAlarm// - DummyCallCrew// - DummyGates// - VcmdAutoStaffOn// - VcmdAutoStaffOff// - VcmdRepairVehicles//// Script by Hoppah// // 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_CONTROLPANEL[] = "fire_station_controlpanel";const char NAME_CONTROLPANEL2[] = "fire_station_controlpanel2"; const char OBJ_BATTALION[] = "mod:Prototypes/Vehicles/02 LA Fire Department/battalion_chief_vehicle.e4p";const char OBJ_AMBULANCE01[] = "mod:Prototypes/Vehicles/01Ambulance/AMBULANCE1.e4p";const char OBJ_AMBULANCE02[] = "mod:Prototypes/Vehicles/01Ambulance/AMBULANCE1.e4p";const char OBJ_AMBULANCE04[] = "mod:Prototypes/Vehicles/01Ambulance/ALS1.e4p";const char OBJ_USAR[] = "mod:Prototypes/Vehicles/02 LA Fire Department/usar_squad.e4p";const char OBJ_LADDER[] = "mod:Prototypes/Vehicles/01 FDNY/BOTTowerLadder.e4p";const char OBJ_TILLER[] = "mod:Prototypes/Vehicles/02 LA Fire Department/tiller_cabin.e4p";const char OBJ_RESCUE_ENGINE01[] = "mod:Prototypes/Vehicles/02 LA Fire Department/rescue_engine1.e4p";const char OBJ_ENGINE02[] = "mod:Prototypes/Vehicles/02 LA Fire Department/fire_engine2.e4p";const char OBJ_RESCUE_ENGINE02[] = "mod:Prototypes/Vehicles/02 LA Fire Department/rescue_engine2.e4p";const char OBJ_HAZMATSQUAD[] = "mod:Prototypes/Vehicles/02 LA Fire Department/hazmat_squad.e4p"; const char OBJ_CHIEF[] = "mod:Prototypes/Persons/02 LA Fire Department/battalion_chief.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_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_ENGINEER[] = "mod:Prototypes/Persons/04 LA Tec/engineer.e4p"; const char NAME_GATE01A[] = "fs_gate01a";const char NAME_GATE02A[] = "fs_gate02a";const char NAME_GATE03A[] = "fs_gate03a";const char NAME_GATE04A[] = "fs_gate04a";const char NAME_GATE05A[] = "fs_gate05a";const char NAME_GATE06A[] = "fs_gate06a";const char NAME_GATE07A[] = "fs_gate07a";const char NAME_GATE08A[] = "fs_gate08a";const char NAME_GATE01B[] = "fs_gate01b";const char NAME_GATE02B[] = "fs_gate02b";const char NAME_GATE03B[] = "fs_gate03b";const char NAME_GATE04B[] = "fs_gate04b";const char NAME_GATE05B[] = "fs_gate05b";const char NAME_GATE06B[] = "fs_gate06b";const char NAME_GATE07B[] = "fs_gate07b";const char NAME_GATE08B[] = "fs_gate08b";const char VO_GATE01A[] = "fs_vogate01a";const char VO_GATE02A[] = "fs_vogate02a";const char VO_GATE03A[] = "fs_vogate03a";const char VO_GATE04A[] = "fs_vogate04a";const char VO_GATE05A[] = "fs_vogate05a";const char VO_GATE06A[] = "fs_vogate06a";const char VO_GATE07A[] = "fs_vogate07a";const char VO_GATE08A[] = "fs_vogate08a";const char VO_GATE01B[] = "fs_vogate01b";const char VO_GATE02B[] = "fs_vogate02b";const char VO_GATE03B[] = "fs_vogate03b";const char VO_GATE04B[] = "fs_vogate04b";const char VO_GATE05B[] = "fs_vogate05b";const char VO_GATE06B[] = "fs_vogate06b";const char VO_GATE07B[] = "fs_vogate07b";const char VO_GATE08B[] = "fs_vogate08b"; const char DUMMY_GATES[] = "DummyGates";const char DUMMY_ALARM[] = "DummyDisableAlarm";const char DUMMY_CALLCREW[] = "DummyCallCrew";const char DUMMY_VCALLED[] = "DummyVehicleCalled"; const char VO_BATTALION[] = "fs_battalion";const char VO_AMBULANCE01[] = "fs_ambulance01";const char VO_AMBULANCE02[] = "fs_ambulance02";const char VO_AMBULANCE03[] = "fs_ambulance03";const char VO_AMBULANCE04[] = "fs_ambulance04";const char VO_USAR[] = "fs_usar";const char VO_LADDER[] = "fs_ladder";const char VO_RESCUE_ENGINE01[] = "fs_rescue_engine01";const char VO_ENGINE02[] = "fs_engine02";const char VO_RESCUE_ENGINE02[] = "fs_rescue_engine02";const char VO_ENGINE04[] = "fs_engine04";const char VO_ENGINE05[] = "fs_engine05";const char VO_HAZMAT[] = "fs_hazmat"; const char VO_SPAWN01[] = "fs_spawn01";const char VO_SPAWN02[] = "fs_spawn02";const char VO_SPAWN03[] = "fs_spawn03"; const char VO_MOVETO01[] = "fs_moveto01";const char VO_MOVETO02[] = "fs_moveto02"; const char VO_SQUAD01[] = "fs_squad01";const char VO_SQUAD02[] = "fs_squad02"; const char SND_ALARM[] = "mod:Audio/FX/Misc/fire_alarm.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"; const char HINT_NO_REPAIR[]  = "There are no vehicles to repair!";const char HINT_REPAIRED[]  = "All vehicles repaired!";int PRICE_REPAIR  = 1000; int DummyGroup = 20; const char VO_SPAWN04[] ="fs_spawn04";const char VO_MOVETO04[] ="fs_moveto04"; const char NAME_GATE09A[] = "fs_gate09a";const char NAME_GATE10A[] = "fs_gate10a";const char NAME_GATE11A[] = "fs_gate11a";const char VO_GATE09A[] = "fs_vogate09a";const char VO_GATE10A[] = "fs_vogate10a";const char VO_GATE11A[] = "fs_vogate11a"; const char OBJ_STATION1B1[] = "mod:Prototypes/Vehicles/02 LA Fire Department/brush_truck (2).e4p";const char OBJ_STATION1B2[] = "mod:Prototypes/Vehicles/02 LA Fire Department/heavy_rescue_crane.e4p";const char OBJ_STATION1B3[] = "mod:Prototypes/Vehicles/02 LA Fire Department/swr_truck.e4p";const char OBJ_STATION3B1[] = "mod:Prototypes/Vehicles/02 LA Fire Department/fire_engine3.e4p";const char OBJ_STATION3B2[] = "mod:Prototypes/Vehicles/02 LA Fire Department/usar_squad (2).e4p";const char OBJ_STATION3B3[] = "mod:Prototypes/Vehicles/02 LA Fire Department/fire_engine4.e4p";const char OBJ_STATION3B4[] = "mod:Prototypes/Vehicles/02 LA Fire Department/crashtender.e4p";const char OBJ_STATOIN3B5[] = "mod:Prototypes/Vehicles/02 LA Fire Department/battalion_chief_vehicle_2.e4p";const char OBJ_BRUSH[] = "mod:Prototypes/Vehicles/02 LA Fire Department/brush_truck.e4p";const char OBJ_HES[] = "mod:Prototypes/Vehicles/02 LA Fire Department/heavy_equipment_squad.e4p"; const char VO_SQUAD03[] = "fs_squad03";const char NAME_FIRESTATION3[] = "fire_station3";const char NAME_FIRESTATION3_ROOF[] = "fire_station3_roof";const char NAME_CONTROLPANEL3[] = "fire_station_controlpanel3";const char VO_STATION1B1[] = "fs_station1b1";const char VO_STATION1B2[] = "fs_station1b2";const char VO_STATION1B3[] = "fs_station1b3";const char VO_STATION3B1[] = "fs_station3b1";const char VO_STATION3B2[] = "fs_station3b2";const char VO_STATION3B3[] = "fs_station3b3";const char VO_STATION3B4[] = "fs_station3b4";const char VO_STATION3B5[] = "fs_station3b5";  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 false; 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_ALARM, AlarmSnd, true);obj->SetUserData(soundID);obj->AttachSound(soundID);}}GameObjectList l2;  Game::CollectObstaclesOnVirtualObject(VO_BATTALION, 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_AMBULANCE01, l3, ACTOR_VEHICLE);if(l3.GetNumObjects() > 0){Vehicle m = l3.GetObject(0);PersonList passengers = m.GetPassengers();if (passengers.GetNumPersons() == 0){if(StrCompare(m.GetPrototypeFileName(), OBJ_HAZMATSQUAD) == 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); } else{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 l4;  Game::CollectObstaclesOnVirtualObject(VO_AMBULANCE02, l4, ACTOR_VEHICLE);if(l4.GetNumObjects() > 0){Vehicle m = l4.GetObject(0);PersonList passengers = m.GetPassengers();if (passengers.GetNumPersons() == 0){if(StrCompare(m.GetPrototypeFileName(), OBJ_AMBULANCE01) == 0){m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 7, false);//m.PushActionWait(ACTION_APPEND, 0.5f);//m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);} else{m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 1, false);m.PushActionWait(ACTION_APPEND, 0.5f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 2, false);}}}GameObjectList l5;  Game::CollectObstaclesOnVirtualObject(VO_AMBULANCE03, l5, ACTOR_VEHICLE);if(l5.GetNumObjects() > 0){Vehicle m = l5.GetObject(0);PersonList passengers = m.GetPassengers();if (passengers.GetNumPersons() == 0){if(StrCompare(m.GetPrototypeFileName(), OBJ_AMBULANCE01) == 0){m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 7, false);//m.PushActionWait(ACTION_APPEND, 0.5f);//m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);} else{m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 1, false);m.PushActionWait(ACTION_APPEND, 0.5f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 2, false);}}}GameObjectList l6;  Game::CollectObstaclesOnVirtualObject(VO_LADDER, l6, ACTOR_VEHICLE);if(l6.GetNumObjects() > 0){Vehicle m = l6.GetObject(0);PersonList passengers = m.GetPassengers();if (passengers.GetNumPersons() == 0){m.PushActionWait(ACTION_NEWLIST, 1.4f);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_USAR, 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, 6, false);m.PushActionWait(ACTION_APPEND, 0.5f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 6, false);}}GameObjectList l8;  Game::CollectObstaclesOnVirtualObject(VO_RESCUE_ENGINE01, l8, ACTOR_VEHICLE);if(l8.GetNumObjects() > 0){Vehicle m = l8.GetObject(0);PersonList passengers = m.GetPassengers();if (passengers.GetNumPersons() == 0){if(StrCompare(m.GetPrototypeFileName(), OBJ_RESCUE_ENGINE01) == 0){m.PushActionWait(ACTION_NEWLIST, 2.0f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);m.PushActionWait(ACTION_APPEND, 0.5f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, 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);} else{m.PushActionWait(ACTION_NEWLIST, 2.0f);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_ENGINE02, l9, ACTOR_VEHICLE);if(l9.GetNumObjects() > 0){Vehicle m = l9.GetObject(0);PersonList passengers = m.GetPassengers();if (passengers.GetNumPersons() == 0){if(StrCompare(m.GetPrototypeFileName(), OBJ_RESCUE_ENGINE01) == 0){m.PushActionWait(ACTION_NEWLIST, 2.0f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);m.PushActionWait(ACTION_APPEND, 0.5f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, 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);} else{m.PushActionWait(ACTION_NEWLIST, 2.0f);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 l10;  Game::CollectObstaclesOnVirtualObject(VO_RESCUE_ENGINE02, l10, ACTOR_VEHICLE);if(l10.GetNumObjects() > 0){Vehicle m = l10.GetObject(0);PersonList passengers = m.GetPassengers();if (passengers.GetNumPersons() == 0){if(StrCompare(m.GetPrototypeFileName(), OBJ_RESCUE_ENGINE02) == 0){m.PushActionWait(ACTION_NEWLIST, 2.0f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);m.PushActionWait(ACTION_APPEND, 0.5f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, 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);} else{m.PushActionWait(ACTION_NEWLIST, 2.0f);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 l11;  Game::CollectObstaclesOnVirtualObject(VO_ENGINE04, l11, ACTOR_VEHICLE);if(l11.GetNumObjects() > 0){Vehicle m = l11.GetObject(0);PersonList passengers = m.GetPassengers();if (passengers.GetNumPersons() == 0){if(StrCompare(m.GetPrototypeFileName(), OBJ_RESCUE_ENGINE01) == 0){m.PushActionWait(ACTION_NEWLIST, 2.0f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);m.PushActionWait(ACTION_APPEND, 0.5f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, 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);} else{m.PushActionWait(ACTION_NEWLIST, 2.0f);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 l12;  Game::CollectObstaclesOnVirtualObject(VO_STATION1B1, l12, ACTOR_VEHICLE);if(l12.GetNumObjects() > 0){Vehicle m = l12.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);}}GameObjectList l13;  Game::CollectObstaclesOnVirtualObject(VO_STATION1B2, l13, ACTOR_VEHICLE);if(l13.GetNumObjects() > 0){Vehicle m = l13.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);}}GameObjectList l14;  Game::CollectObstaclesOnVirtualObject(VO_STATION1B3, l14, ACTOR_VEHICLE);if(l14.GetNumObjects() > 0){Vehicle m = l14.GetObject(0);PersonList passengers = m.GetPassengers();if (passengers.GetNumPersons() == 0){m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 1, false);m.PushActionWait(ACTION_APPEND, 0.5f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);}}}else 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_ALARM, AlarmSnd, true);obj->SetUserData(soundID);obj->AttachSound(soundID);}}GameObjectList l2;  Game::CollectObstaclesOnVirtualObject(VO_AMBULANCE04, l2, ACTOR_VEHICLE);if(l2.GetNumObjects() > 0){Vehicle m = l2.GetObject(0);PersonList passengers = m.GetPassengers();if (passengers.GetNumPersons() == 0){if(StrCompare(m.GetPrototypeFileName(), OBJ_HES) == 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.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 1, false);m.PushActionWait(ACTION_APPEND, 0.5f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 2, false);}}}GameObjectList l3;  Game::CollectObstaclesOnVirtualObject(VO_ENGINE05, l3, ACTOR_VEHICLE);if(l3.GetNumObjects() > 0){Vehicle m = l3.GetObject(0);PersonList passengers = m.GetPassengers();if (passengers.GetNumPersons() == 0){m.PushActionWait(ACTION_NEWLIST, 2.0f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);m.PushActionWait(ACTION_APPEND, 0.5f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, 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_HAZMAT, 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, 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);}}}else if(Caller->HasName(NAME_CONTROLPANEL3)) //= fire station 3{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_ALARM, AlarmSnd, true);obj->SetUserData(soundID);obj->AttachSound(soundID);}}GameObjectList l2;  Game::CollectObstaclesOnVirtualObject(VO_STATION3B1, l2, ACTOR_VEHICLE);if(l2.GetNumObjects() > 0){Vehicle m = l2.GetObject(0);PersonList passengers = m.GetPassengers();if (passengers.GetNumPersons() == 0){m.PushActionWait(ACTION_NEWLIST, 2.0f);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 l3;  Game::CollectObstaclesOnVirtualObject(VO_STATION3B2, l3, ACTOR_VEHICLE);if(l3.GetNumObjects() > 0){Vehicle m = l3.GetObject(0);PersonList passengers = m.GetPassengers();if (passengers.GetNumPersons() == 0){m.PushActionWait(ACTION_NEWLIST, 2.0f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);m.PushActionWait(ACTION_APPEND, 0.5f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, 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_STATION3B3, 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, 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_STATION3B4, 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, 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, 1, false);m.PushActionWait(ACTION_APPEND, 0.5f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);}}GameObjectList l6;Game::CollectObstaclesOnVirtualObject(VO_STATION3B5, 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, 1, false);}}}}}; object VcmdRoof : CommandScript{VcmdRoof(){SetCursor("roof");SetIcon("roof");} bool CheckPossible(GameObject *Caller){if (!Caller->IsValid())return false; if (!Game::IsFreeplay() && !Game::IsMultiplayer())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{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);} }}if(Caller->HasName(NAME_CONTROLPANEL3)) //= fire station 3{GameObjectList l1 = Game::GetGameObjects(NAME_FIRESTATION3_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 false; 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 1Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_GATES, Caller, 1, false);else if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_GATES, Caller, 3, false);else if(Caller->HasName(NAME_CONTROLPANEL3)) //= fire station 3Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_GATES, Caller, 11, false);}}; object VcmdGarageDoorsDown : CommandScript{VcmdGarageDoorsDown(){SetCursor("garagedoordown");SetIcon("garagedoordown");} bool CheckPossible(GameObject *Caller){if (!Caller->IsValid())return false; if (!Game::IsFreeplay() && !Game::IsMultiplayer())return false; 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 1Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_GATES, Caller, 2, false);else if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_GATES, Caller, 4, false);else if(Caller->HasName(NAME_CONTROLPANEL3)) //= fire station 3Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_GATES, Caller, 12, false);}}; object VcmdCallEMT : CommandScript{VcmdCallEMT(){SetCursor("alarm");SetIcon("callemt");} bool CheckPossible(GameObject *Caller){if (!Caller->IsValid())return false; if (!Game::IsFreeplay() && !Game::IsMultiplayer())return false; 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);}else if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2{ActorList l1 = Game::GetActors(VO_SPAWN03);ActorList l2 = Game::GetActors(VO_MOVETO02);}else if(Caller->HasName(NAME_CONTROLPANEL3)) //= fire station 3{ActorList l1 = Game::GetActors(VO_SPAWN04);ActorList l2 = Game::GetActors(VO_MOVETO04);}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 false; 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);}else if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2{ActorList l1 = Game::GetActors(VO_SPAWN03);ActorList l2 = Game::GetActors(VO_MOVETO02);}else if(Caller->HasName(NAME_CONTROLPANEL3)) //= fire station 3{ActorList l1 = Game::GetActors(VO_SPAWN04);ActorList l2 = Game::GetActors(VO_MOVETO04);}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 false; 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);}else if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2{ActorList l1 = Game::GetActors(VO_SPAWN03);ActorList l2 = Game::GetActors(VO_MOVETO02);}else if(Caller->HasName(NAME_CONTROLPANEL3)) //= fire station 3{ActorList l1 = Game::GetActors(VO_SPAWN04);ActorList l2 = Game::GetActors(VO_MOVETO04);}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 false; 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);}else if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2{ActorList l1 = Game::GetActors(VO_SPAWN03);ActorList l2 = Game::GetActors(VO_MOVETO02);}else if(Caller->HasName(NAME_CONTROLPANEL3)) //= fire station 3{ActorList l1 = Game::GetActors(VO_SPAWN04);ActorList l2 = Game::GetActors(VO_MOVETO04);}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 false; 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);}else if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2{ActorList l1 = Game::GetActors(VO_SPAWN03);ActorList l2 = Game::GetActors(VO_MOVETO02);}else if(Caller->HasName(NAME_CONTROLPANEL3)) //= fire station 3{ActorList l1 = Game::GetActors(VO_SPAWN04);ActorList l2 = Game::GetActors(VO_MOVETO04);}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 false; 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);}else if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2{ActorList l1 = Game::GetActors(VO_SPAWN03);ActorList l2 = Game::GetActors(VO_MOVETO02);}else if(Caller->HasName(NAME_CONTROLPANEL3)) //= fire station 3{ActorList l1 = Game::GetActors(VO_SPAWN04);ActorList l2 = Game::GetActors(VO_MOVETO04);}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 VcmdCallDiver : CommandScript{VcmdCallDiver(){SetCursor("alarm");SetIcon("calldiver");} bool CheckPossible(GameObject *Caller){if (!Caller->IsValid())return false; if (!Game::IsFreeplay() && !Game::IsMultiplayer())return false; 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);}else if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2{ActorList l1 = Game::GetActors(VO_SPAWN03);ActorList l2 = Game::GetActors(VO_MOVETO02);}else if(Caller->HasName(NAME_CONTROLPANEL3)) //= fire station 3{ActorList l1 = Game::GetActors(VO_SPAWN04);ActorList l2 = Game::GetActors(VO_MOVETO04);}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 false; 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);}else if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2{ActorList l1 = Game::GetActors(VO_SPAWN03);ActorList l2 = Game::GetActors(VO_MOVETO02);}else if(Caller->HasName(NAME_CONTROLPANEL3)) //= fire station 3{ActorList l1 = Game::GetActors(VO_SPAWN04);ActorList l2 = Game::GetActors(VO_MOVETO04);}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_HAZMAT, 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 false; 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);}else if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2{ActorList l1 = Game::GetActors(VO_SPAWN03);ActorList l2 = Game::GetActors(VO_MOVETO02);}else if(Caller->HasName(NAME_CONTROLPANEL3)) //= fire station 3{ActorList l1 = Game::GetActors(VO_SPAWN04);ActorList l2 = Game::GetActors(VO_MOVETO04);}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 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);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_SPAWN03);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)) //= fire station 3{ActorList l1 = Game::GetActors(VO_SPAWN04);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 1GameObjectList l1 = Game::GetGameObjects(NAME_FIRESTATION);else if(Caller->HasName(NAME_CONTROLPANEL2) || Caller->HasName(NAME_FIRESTATION2)) //= fire station 2GameObjectList l1 = Game::GetGameObjects(NAME_FIRESTATION2);else if(Caller->HasName(NAME_CONTROLPANEL3) || Caller->HasName(NAME_FIRESTATION3)) //= fire station 3GameObjectList 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_SPAWN03);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 if(v.IsCollidingWithVirtualObject(VO_SQUAD03) || v.IsCollidingWithVirtualObject(VO_STATION3B4)){ActorList l1 = Game::GetActors(VO_SPAWN04);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);*/}}}else{ActorList l1 = Game::GetActors(VO_SPAWN02);if(l1.GetNumActors() > 0)Vector Spawn = l1.GetActor(0)->GetPosition();} 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_PM_STRETCHER, 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_USARFF, UNNAMED);else if (ChildID == 7)Person p = Game::CreatePerson(OBJ_EMT_STRETCHER, UNNAMED);elsereturn; 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 gate09a = Game::GetGameObjects(NAME_GATE09A);GameObjectList gate10a = Game::GetGameObjects(NAME_GATE10A);GameObjectList gate11a = Game::GetGameObjects(NAME_GATE11A);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 vogate09a = Game::GetActors(VO_GATE09A);ActorList vogate10a = Game::GetActors(VO_GATE10A);ActorList vogate11a = Game::GetActors(VO_GATE11A);  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 (StrCompare(v.GetPrototypeFileName(), OBJ_HAZMATSQUAD) == 0){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_LADDER) == 0 || 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_RESCUE_ENGINE01) == 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(StrCompare(v.GetPrototypeFileName(), OBJ_RESCUE_ENGINE02) == 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){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(ChildID == 6) //= Battalion chief 'calls vehicle cmds' for opening/closing front gates fire station 2{Vehicle v(Caller);if(StrCompare(v.GetPrototypeFileName(), OBJ_BRUSH) == 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_RESCUE_ENGINE01) == 0 || StrCompare(v.GetPrototypeFileName(), OBJ_RESCUE_ENGINE2) == 0 || StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE02) == 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 (StrCompare(v.GetPrototypeFileName(), OBJ_HES) == 0){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 (StrCompare(v.GetPrototypeFileName(), OBJ_HAZMATSQUAD) == 0) {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_LADDER) == 0 || 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_RESCUE_ENGINE01) == 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(StrCompare(v.GetPrototypeFileName(), OBJ_RESCUE_ENGINE02) == 0){for(int i=0; i < gate05a.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);} else{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 < 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(ChildID == 8) //To fire station cmd to open rear gates fire station 2{Vehicle v(Caller);if(StrCompare(v.GetPrototypeFileName(), OBJ_BRUSH) == 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_RESCUE_ENGINE01) == 0 || StrCompare(v.GetPrototypeFileName(), OBJ_RESCUE_ENGINE2) == 0 || StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE02) == 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(StrCompare(v.GetPrototypeFileName(), OBJ_HES) == 0){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 (StrCompare(v.GetPrototypeFileName(), OBJ_HAZMATSQUAD) == 0){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_LADDER) == 0 || 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_RESCUE_ENGINE01) == 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(StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE02) == 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){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(ChildID == 10) //To fire station cmd to close rear gates fire station 2{Vehicle v(Caller);if(StrCompare(v.GetPrototypeFileName(), OBJ_BRUSH) == 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_RESCUE_ENGINE01) == 0 || StrCompare(v.GetPrototypeFileName(), OBJ_RESCUE_ENGINE2) == 0 || StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE02) == 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(StrCompare(v.GetPrototypeFileName(), OBJ_HES) == 0){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 == 11) //= Open front gates fire station 3{for(int i=0; i < gate09a.GetNumObjects(); i++){GameObject *gate = gate09a.GetObject(i);Actor *vogate = vogate09a.GetActor(i);if (gate->GetUserData() == 0){ gate->SetUserData(1);gate->SetAnimation(ANI_OPEN);vogate->SetVirtualObjectTerrain(VOSET_ROAD);}}for(int i=0; i < gate10a.GetNumObjects(); i++){GameObject *gate = gate10a.GetObject(i);Actor *vogate = vogate10a.GetActor(i);if (gate->GetUserData() == 0){ gate->SetUserData(1);gate->SetAnimation(ANI_OPEN);vogate->SetVirtualObjectTerrain(VOSET_ROAD);}}for(int i=0; i < gate11a.GetNumObjects(); i++){GameObject *gate = gate11a.GetObject(i);Actor *vogate = vogate11a.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 == 12) //= Close all opened gates fire station 3{for(int i=0; i < gate09a.GetNumObjects(); i++){GameObject *gate = gate09a.GetObject(i);Actor *vogate = vogate09a.GetActor(i);if (gate->GetUserData() == 1){ gate->SetUserData(0);gate->SetAnimation(ANI_CLOSE);vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);}}for(int i=0; i < gate10a.GetNumObjects(); i++){GameObject *gate = gate10a.GetObject(i);Actor *vogate = vogate10a.GetActor(i);if (gate->GetUserData() == 1){ gate->SetUserData(0);gate->SetAnimation(ANI_CLOSE);vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);}}for(int i=0; i < gate11a.GetNumObjects(); i++){GameObject *gate = gate11a.GetObject(i);Actor *vogate = vogate11a.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);}}}}}; object VcmdAutoStaffOn : CommandScript{VcmdAutoStaffOn(){SetIcon("autostaffon");SetCursor("autostaffon");} bool CheckPossible(GameObject *Caller){if (!Caller->IsValid() || !Game::IsFreeplay())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){Caller->RemoveCommand("VcmdAutoStaffOn");Caller->AssignCommand("VcmdAutoStaffOff");}}; object VcmdAutoStaffOff : CommandScript{VcmdAutoStaffOff(){SetIcon("autostaffoff");SetCursor("autostaffoff");} bool CheckPossible(GameObject *Caller){if (!Caller->IsValid() || !Game::IsFreeplay())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){Caller->RemoveCommand("VcmdAutoStaffOff");Caller->AssignCommand("VcmdAutoStaffOn");}}; object VcmdRepairVehicles : CommandScript{VcmdRepairVehicles(){SetCursor("repair");SetIcon("repair");} bool CheckPossible(GameObject *Caller){if (!Caller->IsValid())return false; if (!Game::IsFreeplay() && !Game::IsMultiplayer())return false; int Money = Mission::GetMoneyLeft();if (Money < PRICE_REPAIR)return false;  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())return false; return true;} void PushActions(GameObject *Caller, Actor *Target, int ChildID){if (ChildID == 0){Vehicle cp(Caller);GameObjectList l1;ActorList l2, l3;if(Caller->HasName(NAME_CONTROLPANEL)){Game::CollectObstaclesOnVirtualObject(VO_SQUAD01, l1, ACTOR_VEHICLE);l2 = Game::GetActors(VO_SPAWN01);l3 = Game::GetActors(VO_MOVETO01);}else if(Caller->HasName(NAME_CONTROLPANEL2)){Game::CollectObstaclesOnVirtualObject(VO_SQUAD02, l1, ACTOR_VEHICLE);l2 = Game::GetActors(VO_SPAWN02);l3 = Game::GetActors(VO_MOVETO02);}else if(Caller->HasName(NAME_CONTROLPANEL3)){Game::CollectObstaclesOnVirtualObject(VO_SQUAD03, l1, ACTOR_VEHICLE);l2 = Game::GetActors(VO_SPAWN04);l3 = Game::GetActors(VO_MOVETO04);} Vector Spawn = l2.GetActor(0)->GetPosition();Vector MoveTo = l3.GetActor(0)->GetPosition();bool repair = false;for(int i=0; i < l1.GetNumObjects(); i++){if (!repair){Vehicle obj = l1.GetObject(i);if (!obj.HasCommand(DUMMY_VCALLED) && obj.GetEnergy() < obj.GetMaxEnergy())repair = true;}}if (repair){int Money = Mission::GetMoneyLeft();if (Money >= PRICE_REPAIR){int NewMoney = Money - PRICE_REPAIR;Mission::SetMoney(NewMoney); } Person p = Game::CreatePerson(OBJ_ENGINEER, UNNAMED);if (Game::FindFreePosition(&p, Spawn)){p.SetUpgradeLevel(3);p.SetEquipment(EQUIP_THW_CASE);Game::FindFreePosition(&p, Spawn);p.SetPosition(Spawn);p.PushActionMove(ACTION_NEWLIST, MoveTo);p.PushActionExecuteCommand(ACTION_APPEND, "VcmdRepairVehicles", &cp, 1, false);}} elseMission::PlayHint(HINT_NO_REPAIR);}if (ChildID == 1){Person p(Caller);Vehicle cp(Target);GameObjectList l1;ActorList l2;bool repair = false; if(cp.HasName(NAME_CONTROLPANEL)){Game::CollectObstaclesOnVirtualObject(VO_SQUAD01, l1, ACTOR_VEHICLE);l2 = Game::GetActors(VO_SPAWN01);} if(cp.HasName(NAME_CONTROLPANEL2)){Game::CollectObstaclesOnVirtualObject(VO_SQUAD02, l1, ACTOR_VEHICLE);l2 = Game::GetActors(VO_SPAWN02);}if(cp.HasName(NAME_CONTROLPANEL3)){Game::CollectObstaclesOnVirtualObject(VO_SQUAD03, l1, ACTOR_VEHICLE);l2 = Game::GetActors(VO_SPAWN04);} Vector Delete = l2.GetActor(0)->GetPosition(); for(int i=0; i < l1.GetNumObjects(); i++){if (!repair){Vehicle obj = l1.GetObject(i);if (!obj.HasCommand(DUMMY_VCALLED) && obj.GetEnergy() < obj.GetMaxEnergy())repair = true;}}if (repair){p.PushActionMove(ACTION_NEWLIST, &obj, TARGET_ANY);p.PushActionTurnTo(ACTION_APPEND, &obj);p.PushActionRepair(ACTION_APPEND, &obj);p.PushActionExecuteCommand(ACTION_APPEND, "VcmdRepairVehicles", &cp, 1, false);} else{Mission::PlayHint(HINT_REPAIRED);p.PushActionMove(ACTION_NEWLIST, Delete);p.PushActionDeleteOwner(ACTION_APPEND);} }}};

 

//******************************************************************************************// #Version 1.4#////  Includes: To fire station command.//// - VcmdToFireStation//// Script by Hoppah// // Usage of this script in other mods is NOT allowed without permission of Hoppah////****************************************************************************************** const char CMD_SIREN[] = "VcmdSiren";const char CMD_AUTOSIREN_OFF[] = "VcmdAutoSirenOff";const char CMD_WARNINGLIGHTS[]  = "VcmdWarningLightsOn";const char DUMMY_WARNINGLIGHTS[] = "DummyHasWarningLights";const char CMD_FLOODLIGHTS_OFF[]  = "VcmdFloodLightsOff";const char CMD_FLOODLIGHTS_ON[]  = "VcmdFloodLightsOn";const char CMD_GETTILLER[]  = "VcmdGetTiller";const char CMD_FLASHINGLIGHTS[]  = "VcmdFlashingLights";const char CMD_GOHOME[]  = "GoHome";const char CMD_TOHOSPITAL[]  = "VcmdToHospital";const char CMD_TOFIRESTATION[]  = "VcmdToFireStation";const char CMD_PATROL[]  = "VcmdPatrol";const char CMD_STANDBY_ON[] = "VcmdStandbyOn";const char CMD_STANDBY_OFF[] = "VcmdStandbyOff";const char CMD_GETTILLER[]  = "VcmdGetTiller";const char DUMMY_TILLERGOHOME[] = "DummyTillerGoHome";const char DUMMY_DISABLE[]  = "DummyDisableSiren";const char DUMMY_HASSIREN[]  = "DummyHasSiren";const char DUMMY_PATROL[]  = "DummyPatrol";const char DUMMY_GATES[] = "DummyGates";const char DUMMY_FIRESTATION[] = "DummyAtFireStation";const char DUMMY_CHECKPARKED[]  = "DummyCheckParked";const char DUMMY_ISTRAILED[]  = "DummyIsTrailed";const char DUMMY_VCALLED[] = "DummyVehicleCalled";const char DUMMY_HOSESON[]  = "DummyHosesAreOn";const char DUMMY_TILLER[]  = "DummyTiller";const char OBJ_BATTALION[] = "mod:Prototypes/Vehicles/02 LA Fire Department/battalion_chief_vehicle.e4p";const char OBJ_RESCUE_ENGINE01[] = "mod:Prototypes/Vehicles/02 LA Fire Department/rescue_engine1.e4p";const char OBJ_RESCUE_ENGINE02[] = "mod:Prototypes/Vehicles/02 LA Fire Department/rescue_engine2.e4p";const char OBJ_USAR[] = "mod:Prototypes/Vehicles/02 LA Fire Department/usar_squad.e4p";const char OBJ_LADDER[] = "mod:Prototypes/Vehicles/01 FDNY/BOTTowerLadder.e4p";const char OBJ_TILLER[] = "mod:Prototypes/Vehicles/02 LA Fire Department/tiller_cabin.e4p";const char OBJ_BATTALION[] = "mod:Prototypes/Vehicles/02 LA Fire Department/battalion_chief_vehicle.e4p";const char OBJ_HAZMATSQUAD[] = "mod:Prototypes/Vehicles/02 LA Fire Department/hazmat_squad.e4p";const char OBJ_AMBULANCE01[] = "mod:Prototypes/Vehicles/01Ambulance/AMBULANCE1.e4p";const char OBJ_AMBULANCE02[] = "mod:Prototypes/Vehicles/01Ambulance/AMBULANCE1.e4p";const char OBJ_AMBULANCE03[] = "mod:Prototypes/Vehicles/01Ambulance/AMBULANCE1.e4p";const char OBJ_AMBULANCE04[] = "mod:Prototypes/Vehicles/01Ambulance/ALS1.e4p";const char VO_SPAWN01[] = "fs_spawn01";const char VO_SPAWN02[] = "fs_spawn02";const char VO_SPAWN03[] = "fs_spawn03";const char VO_FP1[] = "fs_gate01";const char VO_FP2[] = "fs_gate02";const char VO_FP3[] = "fs_gate03";const char VO_FP4[] = "fs_gate04";const char VO_FP5[] = "fs_gate05";const char VO_FP6[] = "fs_gate06";const char VO_FP7[] = "fs_gate07";const char VO_FP8[] = "fs_gate08";const char VO_TURNTO1[] = "fs_vogate01a";const char VO_TURNTO2[] = "fs_vogate02a";const char VO_TURNTO3[] = "fs_vogate03a";const char VO_TURNTO4[] = "fs_vogate04a";const char VO_TURNTO5[] = "fs_vogate05a";const char VO_TURNTO6[] = "fs_vogate06a";const char VO_TURNTO7[] = "fs_vogate07a";const char VO_TURNTO8[] = "fs_vogate08a";const char VO_AMBULANCE01[]  = "fs_ambulance01";const char VO_AMBULANCE02[]  = "fs_ambulance02";const char VO_AMBULANCE03[]  = "fs_ambulance03";const char VO_AMBULANCE04[]  = "fs_ambulance04";const char VO_RESCUE_ENGINE01[] = "fs_rescue_engine01";const char VO_ENGINE02[] = "fs_engine02";const char VO_RESCUE_ENGINE02[] = "fs_rescue_engine02";const char VO_ENGINE04[] = "fs_engine04";const char VO_ENGINE05[] = "fs_engine05";const char VO_BATTALION[] = "fs_battalion";const char VO_BATTALION2[] = "fs_battalion2";const char VO_USAR[] = "fs_usar";const char VO_LADDER[] = "fs_ladder";const char VO_HAZMAT[] = "fs_hazmat";const char VO_SQUAD01[] = "fs_squad01";const char VO_SQUAD02[] = "fs_squad02";const char SND_TOSTATION[] = "mod:Audio/FX/radio/1019.wav";const char HINT_NOTVALID[]  = "This vehicle doesn't belong in the fire station!";const char HINT_NOSPACE[]  = "No space at the fire station, vehicle returns to base!";const char HINT_NOSPACE_AMBULANCE[]  = "No space at the fire station, vehicle starts a patrol!";const char HINT_TRANSPORTS[]  = "The ambulance has transports, it will go to the hospital first!"; const char NAME_CONTROLPANEL[] = "fire_station_controlpanel";const char NAME_CONTROLPANEL2[] = "fire_station_controlpanel2"; int DummyGroup = 32; object VcmdToFireStation : CommandScript{VcmdToFireStation(){SetCursor("tofirestation");SetIcon("tofirestation");SetGroupID(DummyGroup);  SetGroupLeader(true);SetRestrictions(RESTRICT_SELFEXECUTE);} bool CheckPossible(GameObject *Caller){if (!Caller->IsValid())return false; if (!Game::IsFreeplay())return false;   Vehicle v(Caller);if (v.IsCollidingWithVirtualObject(VO_SQUAD01) || v.IsCollidingWithVirtualObject(VO_SQUAD02) || v.IsCollidingWithVirtualObject(VO_BATTALION) || (v.HasCommand(DUMMY_ISTRAILED) && !v.HasCommand(CMD_GETTILLER)) || v.HasCommand(DUMMY_HOSESON) || v.IsInstalled())return false; if (!v.HasCommand("MoveTo"))return false; if (v.HasCommand(CMD_FLOODLIGHTS_OFF) && (StrCompare(v.GetPrototypeFileName(), OBJ_HAZMATSQUAD) == 0 || StrCompare(v.GetPrototypeFileName(), OBJ_USAR) == 0))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){Vector Pos = Caller->GetPosition(); Vehicle v(Caller);if (v.GetVehicleType() == VT_AMBULANCE_RTW && v.GetNumTransported() > 0){v.PushActionExecuteCommand(ACTION_NEWLIST, CMD_TOHOSPITAL, Caller, 0, false);Mission::PlayHint(HINT_TRANSPORTS);return;}if (v.IsBlueLightEnabled())Game::ExecuteCommand(CMD_FLASHINGLIGHTS, &v, &v);if (v.HasCommand(DUMMY_TILLERGOHOME))v.RemoveCommand(DUMMY_TILLERGOHOME);if (v.HasCommand(CMD_STANDBY_OFF)){v.RemoveCommand(CMD_STANDBY_OFF);v.AssignCommand(CMD_STANDBY_ON);}if (v.HasCommand(DUMMY_WARNINGLIGHTS)){v.EnableBlinker(BLT_NONE);v.RemoveCommand(DUMMY_WARNINGLIGHTS);v.AssignCommand(CMD_WARNINGLIGHTS);}if (v.HasCommand(CMD_FLOODLIGHTS_OFF)){v.EnableSpecialLights(false);v.RemoveCommand(CMD_FLOODLIGHTS_OFF);v.AssignCommand(CMD_FLOODLIGHTS_ON);}if (v.HasObjectPath(NULL))Game::ExecuteCommand(DUMMY_PATROL, &v, &v);if (v.HasCommand(DUMMY_HASSIREN) && v.HasCommand(CMD_AUTOSIREN_OFF))Game::ExecuteCommand(DUMMY_DISABLE, &v, &v);if(StrCompare(v.GetPrototypeFileName(), OBJ_BATTALION) == 0){GameObjectList l4;  Game::CollectObstaclesOnVirtualObject(VO_BATTALION, l4, ACTOR_VEHICLE);if(l4.GetNumObjects() > 0){Mission::PlayHint(HINT_NOSPACE);v.PushActionReturnToBase(ACTION_NEWLIST);return;} else{ActorList l1 = Game::GetActors(VO_BATTALION2);ActorList l2 = Game::GetActors(VO_BATTALION);}}else if(StrCompare(v.GetPrototypeFileName(), OBJ_USAR) == 0){GameObjectList l4;  Game::CollectObstaclesOnVirtualObject(VO_USAR, l4, ACTOR_VEHICLE);if(l4.GetNumObjects() > 0){Mission::PlayHint(HINT_NOSPACE);v.PushActionReturnToBase(ACTION_NEWLIST);return;} else{ActorList l1 = Game::GetActors(VO_FP2);ActorList l2 = Game::GetActors(VO_TURNTO2);}}else if(StrCompare(v.GetPrototypeFileName(), OBJ_LADDER) == 0 || StrCompare(v.GetPrototypeFileName(), OBJ_TILLER) == 0){GameObjectList l4;  Game::CollectObstaclesOnVirtualObject(VO_LADDER, l4, ACTOR_VEHICLE);if(l4.GetNumObjects() > 0){Mission::PlayHint(HINT_NOSPACE);Game::ExecuteCommand(CMD_GOHOME, &v, &v);return;} else{ActorList l1 = Game::GetActors(VO_FP3);ActorList l2 = Game::GetActors(VO_TURNTO3);}}else if(StrCompare(v.GetPrototypeFileName(), OBJ_HAZMATSQUAD) == 0){GameObjectList l4;  Game::CollectObstaclesOnVirtualObject(VO_HAZMAT, l4, ACTOR_VEHICLE);if(l4.GetNumObjects() > 0){Mission::PlayHint(HINT_NOSPACE);v.PushActionReturnToBase(ACTION_NEWLIST);return;} else{ActorList l1 = Game::GetActors(VO_FP6);ActorList l2 = Game::GetActors(VO_TURNTO6);}}else if(StrCompare(v.GetPrototypeFileName(), OBJ_AMBULANCE02) == 0 || StrCompare(v.GetPrototypeFileName(), OBJ_AMBULANCE03) == 0 || StrCompare(v.GetPrototypeFileName(), OBJ_AMBULANCE04) == 0){bool Possible = false; GameObjectList l4;  Game::CollectObstaclesOnVirtualObject(VO_AMBULANCE01, l4, ACTOR_VEHICLE);if(l4.GetNumObjects() == 0 && !Possible)Possible = true; GameObjectList l5;  Game::CollectObstaclesOnVirtualObject(VO_AMBULANCE02, l5, ACTOR_VEHICLE);if(l5.GetNumObjects() == 0 && !Possible)Possible = true; GameObjectList l6;  Game::CollectObstaclesOnVirtualObject(VO_AMBULANCE03, l6, ACTOR_VEHICLE);if(l6.GetNumObjects() == 0 && !Possible)Possible = true; if (Possible){ActorList l1 = Game::GetActors(VO_FP1);ActorList l2 = Game::GetActors(VO_TURNTO1);} else{Mission::PlayHint(HINT_NOSPACE_AMBULANCE);v.PushActionExecuteCommand(ACTION_NEWLIST, CMD_PATROL, Caller, 0, false);return;}}else if(StrCompare(v.GetPrototypeFileName(), OBJ_AMBULANCE01) == 0){bool Possible = false; GameObjectList l4;  Game::CollectObstaclesOnVirtualObject(VO_AMBULANCE04, l4, ACTOR_VEHICLE);if(l4.GetNumObjects() == 0 && !Possible)Possible = true; if (Possible){ActorList l1 = Game::GetActors(VO_FP8);ActorList l2 = Game::GetActors(VO_TURNTO8);} else{Mission::PlayHint(HINT_NOSPACE_AMBULANCE);v.PushActionExecuteCommand(ACTION_NEWLIST, CMD_PATROL, Caller, 0, false);return;}}else if(StrCompare(v.GetPrototypeFileName(), OBJ_RESCUE_ENGINE01) == 0)  {GameObjectList cpl1 = Game::GetGameObjects(NAME_CONTROLPANEL);  if(cpl1.GetNumObjects() > 0)GameObject cp1 = cpl1.GetObject(0);GameObjectList cpl2 = Game::GetGameObjects(NAME_CONTROLPANEL2);  if(cpl2.GetNumObjects() > 0)GameObject cp2 = cpl2.GetObject(0);bool FS1Closer = false;bool FS2Closer = false;if (Math::dist(Pos.x, Pos.y, cp1.GetPosition().x, cp1.GetPosition().y) > Math::dist(Pos.x, Pos.y, cp2.GetPosition().x, cp2.GetPosition().y))FS2Closer = true;elseFS1Closer = true; bool FS1Possible = false;bool FS2Possible = false; GameObjectList l3;  Game::CollectObstaclesOnVirtualObject(VO_RESCUE_ENGINE01, l3, ACTOR_VEHICLE);if(l3.GetNumObjects() == 0 && !FS1Possible)FS1Possible = true; GameObjectList l4;  Game::CollectObstaclesOnVirtualObject(VO_RESCUE_ENGINE01, l4, ACTOR_VEHICLE);if(l4.GetNumObjects() == 0 && !FS1Possible)FS1Possible = true; GameObjectList l5;  Game::CollectObstaclesOnVirtualObject(VO_ENGINE05, l5, ACTOR_VEHICLE);if(l5.GetNumObjects() == 0 && !FS2Possible)FS2Possible = true; if (!FS1Possible && !FS2Possible){Mission::PlayHint(HINT_NOSPACE);v.PushActionReturnToBase(ACTION_NEWLIST);return;}else if ((FS1Closer && FS1Possible) || (FS2Closer && !FS2Possible)){ActorList l1 = Game::GetActors(VO_FP4);ActorList l2 = Game::GetActors(VO_TURNTO4);}else if ((FS2Closer && FS2Possible) || (FS1Closer && !FS1Possible)){ActorList l1 = Game::GetActors(VO_FP7);ActorList l2 = Game::GetActors(VO_TURNTO7);}}else if(StrCompare(v.GetPrototypeFileName(), OBJ_RESCUE_ENGINE02) == 0)  {bool Possible = false; GameObjectList l3;  Game::CollectObstaclesOnVirtualObject(VO_RESCUE_ENGINE02, l3, ACTOR_VEHICLE);if(l3.GetNumObjects() == 0 && !Possible)Possible = true; GameObjectList l4;  Game::CollectObstaclesOnVirtualObject(VO_ENGINE04, l4, ACTOR_VEHICLE);if(l4.GetNumObjects() == 0 && !Possible)Possible = true; if (Possible){ActorList l1 = Game::GetActors(VO_FP5);ActorList l2 = Game::GetActors(VO_TURNTO5);} else{Mission::PlayHint(HINT_NOSPACE);v.PushActionReturnToBase(ACTION_NEWLIST);return;}} else{Mission::PlayHint(HINT_NOTVALID);return;} if(l1.GetNumActors() > 0)Vector FirstPoint = l1.GetActor(0)->GetPosition(); if(l2.GetNumActors() > 0)Vector TurnTo = l2.GetActor(0)->GetPosition(); Audio::PlaySample3D(SND_TOSTATION, Caller->GetPosition());v.PushActionMove(ACTION_NEWLIST, FirstPoint);v.PushActionTurnTo(ACTION_APPEND, TurnTo);if (StrCompare(v.GetPrototypeFileName(), OBJ_TILLER) == 0)v.PushActionExecuteCommand(ACTION_APPEND, DUMMY_TILLER, Caller, 3, false);v.PushActionWait(ACTION_APPEND, 1.0f);v.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CHECKPARKED, Caller, 0, false);}}; object DummyCheckParked : CommandScript{DummyCheckParked(){SetGroupID(DummyGroup);} bool CheckTarget(GameObject *Caller, Actor *Target, int ChildID){} void PushActions(GameObject *Caller, Actor *Target, int ChildID){bool ParkinglotFound = false;Vector Pos = Caller->GetPosition();GameObjectList cpl1 = Game::GetGameObjects(NAME_CONTROLPANEL);  if(cpl1.GetNumObjects() > 0)GameObject cp1 = cpl1.GetObject(0);GameObjectList cpl2 = Game::GetGameObjects(NAME_CONTROLPANEL2);  if(cpl2.GetNumObjects() > 0)GameObject cp2 = cpl2.GetObject(0);bool FS1Closer = false;bool FS2Closer = false;if (Math::dist(Pos.x, Pos.y, cp1.GetPosition().x, cp1.GetPosition().y) > Math::dist(Pos.x, Pos.y, cp2.GetPosition().x, cp2.GetPosition().y))FS2Closer = true;elseFS1Closer = true; Vehicle v(Caller);if(StrCompare(v.GetPrototypeFileName(), OBJ_BATTALION) == 0){GameObjectList l3;  Game::CollectObstaclesOnVirtualObject(VO_BATTALION, l3, ACTOR_VEHICLE);if(l3.GetNumObjects() > 0){Mission::PlayHint(HINT_NOSPACE);v.PushActionReturnToBase(ACTION_NEWLIST);return;} else{ParkinglotFound = true;ActorList l1 = Game::GetActors(VO_BATTALION);ActorList l2 = Game::GetActors(VO_BATTALION2);}}else if(StrCompare(v.GetPrototypeFileName(), OBJ_AMBULANCE02) == 0 || StrCompare(v.GetPrototypeFileName(), OBJ_AMBULANCE03) == 0 || StrCompare(v.GetPrototypeFileName(), OBJ_AMBULANCE04) == 0){ActorList l2 = Game::GetActors(VO_TURNTO1);if (!Game::IsSquadInVirtualObject(VO_AMBULANCE01) && !Game::IsSquadInVirtualObject(VO_AMBULANCE02) && !Game::IsSquadInVirtualObject(VO_AMBULANCE03)){ParkinglotFound = true;ActorList l1 = Game::GetActors(VO_AMBULANCE01);}else if (Game::IsSquadInVirtualObject(VO_AMBULANCE01) && !Game::IsSquadInVirtualObject(VO_AMBULANCE02) && !Game::IsSquadInVirtualObject(VO_AMBULANCE03)){ParkinglotFound = true;ActorList l1 = Game::GetActors(VO_AMBULANCE02);}else if (Game::IsSquadInVirtualObject(VO_AMBULANCE01) && Game::IsSquadInVirtualObject(VO_AMBULANCE02) && !Game::IsSquadInVirtualObject(VO_AMBULANCE03)){ParkinglotFound = true;ActorList l1 = Game::GetActors(VO_AMBULANCE03);}else if (!Game::IsSquadInVirtualObject(VO_AMBULANCE01) && Game::IsSquadInVirtualObject(VO_AMBULANCE02) && !Game::IsSquadInVirtualObject(VO_AMBULANCE03)){ParkinglotFound = true;ActorList l1 = Game::GetActors(VO_AMBULANCE02);ActorList l3 = Game::GetActors(VO_AMBULANCE01);if(l3.GetNumActors() > 0)Vector Forward = l3.GetActor(0)->GetPosition();GameObjectList l4;Game::CollectObstaclesOnVirtualObject(VO_AMBULANCE02, l4, ACTOR_VEHICLE);for (int i = 0; i < l4.GetNumObjects(); i++){Vehicle m = l4.GetObject(i);m.PushActionMove(ACTION_NEWLIST, Forward);}}else if (!Game::IsSquadInVirtualObject(VO_AMBULANCE01) && !Game::IsSquadInVirtualObject(VO_AMBULANCE02) && Game::IsSquadInVirtualObject(VO_AMBULANCE03)){ParkinglotFound = true;ActorList l1 = Game::GetActors(VO_AMBULANCE02); ActorList l3 = Game::GetActors(VO_AMBULANCE01);if(l3.GetNumActors() > 0)Vector Forward = l3.GetActor(0)->GetPosition(); GameObjectList l4;Game::CollectObstaclesOnVirtualObject(VO_AMBULANCE03, l4, ACTOR_VEHICLE);for (int i = 0; i < l4.GetNumObjects(); i++){Vehicle m = l4.GetObject(i);m.PushActionMove(ACTION_NEWLIST, Forward);}}else if (!Game::IsSquadInVirtualObject(VO_AMBULANCE01) && Game::IsSquadInVirtualObject(VO_AMBULANCE02) && Game::IsSquadInVirtualObject(VO_AMBULANCE03)){ParkinglotFound = true;ActorList l1 = Game::GetActors(VO_AMBULANCE03); ActorList l3 = Game::GetActors(VO_AMBULANCE01);if(l3.GetNumActors() > 0)Vector Forward = l3.GetActor(0)->GetPosition(); ActorList l4 = Game::GetActors(VO_AMBULANCE02);if(l4.GetNumActors() > 0)Vector Forward2 = l4.GetActor(0)->GetPosition(); float rot[9];float childRot[9]; GameObjectList l5;Game::CollectObstaclesOnVirtualObject(VO_AMBULANCE02, l5, ACTOR_VEHICLE);for (int i = 0; i < l5.GetNumObjects(); i++){Vehicle m = l5.GetObject(i);m.PushActionMove(ACTION_NEWLIST, Forward);} GameObjectList l6;Game::CollectObstaclesOnVirtualObject(VO_AMBULANCE03, l6, ACTOR_VEHICLE);for (int i = 0; i < l6.GetNumObjects(); i++){Vehicle c = l6.GetObject(i);c.PushActionWait(ACTION_NEWLIST, 0.7f);c.PushActionMove(ACTION_APPEND, Forward2);}} else{Mission::PlayHint(HINT_NOSPACE_AMBULANCE);v.PushActionExecuteCommand(ACTION_NEWLIST, CMD_PATROL, Caller, 0, false);return;}}else if(StrCompare(v.GetPrototypeFileName(), OBJ_AMBULANCE01) == 0){GameObjectList l3;  Game::CollectObstaclesOnVirtualObject(VO_AMBULANCE04, l3, ACTOR_VEHICLE);if(l3.GetNumObjects() > 0){Mission::PlayHint(HINT_NOSPACE_AMBULANCE);v.PushActionExecuteCommand(ACTION_NEWLIST, CMD_PATROL, Caller, 0, false);return;} else{ParkinglotFound = true;ActorList l1 = Game::GetActors(VO_AMBULANCE04);ActorList l2 = Game::GetActors(VO_TURNTO8);}}else if(StrCompare(v.GetPrototypeFileName(), OBJ_USAR) == 0)  {GameObjectList l3;  Game::CollectObstaclesOnVirtualObject(VO_USAR, l3, ACTOR_VEHICLE);if(l3.GetNumObjects() > 0){Mission::PlayHint(HINT_NOSPACE);v.PushActionReturnToBase(ACTION_NEWLIST);return;} else{ParkinglotFound = true;ActorList l1 = Game::GetActors(VO_USAR);ActorList l2 = Game::GetActors(VO_TURNTO2);}}else if(StrCompare(v.GetPrototypeFileName(), OBJ_LADDER) == 0 || StrCompare(v.GetPrototypeFileName(), OBJ_TILLER) == 0)  {GameObjectList l3;  Game::CollectObstaclesOnVirtualObject(VO_LADDER, l3, ACTOR_VEHICLE);if(l3.GetNumObjects() > 0){Mission::PlayHint(HINT_NOSPACE);Game::ExecuteCommand(CMD_GOHOME, &v, &v);return;} else{ParkinglotFound = true;ActorList l1 = Game::GetActors(VO_LADDER);ActorList l2 = Game::GetActors(VO_TURNTO3);}}else if(StrCompare(v.GetPrototypeFileName(), OBJ_HAZMATSQUAD) == 0)  {GameObjectList l3;  Game::CollectObstaclesOnVirtualObject(VO_HAZMAT, l3, ACTOR_VEHICLE);if(l3.GetNumObjects() > 0){Mission::PlayHint(HINT_NOSPACE);v.PushActionReturnToBase(ACTION_NEWLIST);return;} else{ParkinglotFound = true;ActorList l1 = Game::GetActors(VO_HAZMAT);ActorList l2 = Game::GetActors(VO_TURNTO6);}}else if(StrCompare(v.GetPrototypeFileName(), OBJ_RESCUE_ENGINE01) == 0)  {if(FS1Closer){GameObjectList l3;  Game::CollectObstaclesOnVirtualObject(VO_RESCUE_ENGINE01, l3, ACTOR_VEHICLE);if(l3.GetNumObjects() > 0){GameObjectList l4;  Game::CollectObstaclesOnVirtualObject(VO_RESCUE_ENGINE02, l4, ACTOR_VEHICLE);if(l4.GetNumObjects() > 0){v.PushActionExecuteCommand(ACTION_NEWLIST, CMD_TOFIRESTATION, Caller, 0, false);return;} else{ParkinglotFound = true;ActorList l1 = Game::GetActors(VO_RESCUE_ENGINE01);ActorList l2 = Game::GetActors(VO_TURNTO4);}} else{GameObjectList l4;  Game::CollectObstaclesOnVirtualObject(VO_RESCUE_ENGINE02, l4, ACTOR_VEHICLE);if(l4.GetNumObjects() > 0){ActorList l1 = Game::GetActors(VO_RESCUE_ENGINE01);ActorList l5 = Game::GetActors(VO_RESCUE_ENGINE02);Vector Move = l5.GetActor(0)->GetPosition();l4.GetObject(0)->PushActionMove(ACTION_NEWLIST, Move, true);} elseActorList l1 = Game::GetActors(VO_RESCUE_ENGINE01);ActorList l2 = Game::GetActors(VO_TURNTO4);ParkinglotFound = true;}}else if(FS2Closer){GameObjectList l3;  Game::CollectObstaclesOnVirtualObject(VO_ENGINE05, l3, ACTOR_VEHICLE);if(l3.GetNumObjects() > 0){v.PushActionExecuteCommand(ACTION_NEWLIST, CMD_TOFIRESTATION, Caller, 0, false);return;} else{ParkinglotFound = true;ActorList l1 = Game::GetActors(VO_ENGINE05);ActorList l2 = Game::GetActors(VO_TURNTO7);}}}else if(StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE02) == 0)  {GameObjectList l3;  Game::CollectObstaclesOnVirtualObject(VO_ENGINE02, l3, ACTOR_VEHICLE);if(l3.GetNumObjects() > 0){GameObjectList l4;  Game::CollectObstaclesOnVirtualObject(VO_ENGINE04, l4, ACTOR_VEHICLE);if(l4.GetNumObjects() > 0){v.PushActionExecuteCommand(ACTION_NEWLIST, CMD_TOFIRESTATION, Caller, 0, false);return;} else{ParkinglotFound = true;ActorList l1 = Game::GetActors(VO_ENGINE04);ActorList l2 = Game::GetActors(VO_TURNTO5);}} else{GameObjectList l4;  Game::CollectObstaclesOnVirtualObject(VO_ENGINE04, l4, ACTOR_VEHICLE);if(l4.GetNumObjects() > 0){ActorList l1 = Game::GetActors(VO_ENGINE04);ActorList l5 = Game::GetActors(VO_ENGINE02);Vector Move = l5.GetActor(0)->GetPosition();l4.GetObject(0)->PushActionMove(ACTION_NEWLIST, Move, true);} elseActorList l1 = Game::GetActors(VO_ENGINE02);ActorList l2 = Game::GetActors(VO_TURNTO5);ParkinglotFound = true;}}if(ParkinglotFound){if(l1.GetNumActors() > 0){if (StrCompare(v.GetPrototypeFileName(), OBJ_TILLER) == 0){Vector Park = l1.GetActor(0)->GetPosition();float dx = 125.f, dy = 0.f, dz = 0.f;float r[9];float childr[9];v.GetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]);Math::RotateVector(dx, dy, dz, r);Math::EulerToMatrix(0.0f, 0.f, 0.f, childr);Math::MultiplyMatrices(childr, r);Park = Park + Vector(dx, dy, 0);} elseVector Park = l1.GetActor(0)->GetPosition();}if(l2.GetNumActors() > 0)Vector TurnTo = l2.GetActor(0)->GetPosition();if (v.HasCommand(DUMMY_VCALLED))v.RemoveCommand(DUMMY_VCALLED);if(StrCompare(v.GetPrototypeFileName(), OBJ_BATTALION) == 0){v.PushActionMove(ACTION_APPEND, Park);v.PushActionTurnTo(ACTION_APPEND, TurnTo);} else{if(FS1Closer)v.PushActionExecuteCommand(ACTION_APPEND, DUMMY_GATES, Caller, 7, false);elsev.PushActionExecuteCommand(ACTION_APPEND, DUMMY_GATES, Caller, 8, false);v.PushActionWait(ACTION_APPEND, 1.8f); v.PushActionMove(ACTION_APPEND, Park);v.PushActionTurnTo(ACTION_APPEND, TurnTo);v.PushActionWait(ACTION_APPEND, 0.5f);PersonList passengers = v.GetPassengers();if (passengers.GetNumPersons() > 0 && (FS1Closer && cp1.HasCommand("VcmdAutoStaffOff")) || (FS2Closer && cp2.HasCommand("VcmdAutoStaffOff")))v.PushActionExecuteCommand(ACTION_APPEND, DUMMY_FIRESTATION, Caller, 0, false);v.PushActionWait(ACTION_APPEND, 2.2f);if(FS1Closer)v.PushActionExecuteCommand(ACTION_APPEND, DUMMY_GATES, Caller, 9, false);elsev.PushActionExecuteCommand(ACTION_APPEND, DUMMY_GATES, Caller, 10, false);if (v.HasCommand(DUMMY_WARNINGLIGHTS)){v.EnableBlinker(BLT_NONE);v.RemoveCommand(DUMMY_WARNINGLIGHTS);v.AssignCommand(CMD_WARNINGLIGHTS);} elsev.EnableBlinker(BLT_NONE);}}}}; object DummyAtFireStation : CommandScript{DummyAtFireStation(){SetGroupID(DummyGroup);} bool CheckTarget(GameObject *Caller, Actor *Target, int ChildID){} void PushActions(GameObject *Caller, Actor *Target, int ChildID){Vehicle v(Caller);if(StrCompare(v.GetPrototypeFileName(), OBJ_BATTALION) == 0)ActorList l1 = Game::GetActors(VO_SPAWN02);else if(v.IsCollidingWithVirtualObject(VO_SQUAD01))ActorList l1 = Game::GetActors(VO_SPAWN01);else if(v.IsCollidingWithVirtualObject(VO_SQUAD02))ActorList l1 = Game::GetActors(VO_SPAWN03);elsereturn; if(l1.GetNumActors() > 0)Vector Delete = l1.GetActor(0)->GetPosition(); PersonList passengers = v.GetPassengers();if (passengers.GetNumPersons() > 0){for(int i=0; i<passengers.GetNumPersons(); i++){Person *p = passengers.GetPerson(i);p->PushActionLeaveCar(ACTION_NEWLIST, Caller);p->PushActionMove(ACTION_APPEND, Delete);p->PushActionDeleteOwner(ACTION_APPEND);}}}}; object DummyEngine : CommandScript{DummyEngine(){SetGroupID(DummyGroup);} bool CheckTarget(GameObject *Caller, Actor *Target, int ChildID){} void PushActions(GameObject *Caller, Actor *Target, int ChildID){}};

 

//******************************************************************************************// #Version 1.3#////  Includes: Start command de spawn vehicles.//// - VcmdStart//// Script by Hoppah// // 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_CONTROLPANEL[] = "fire_station_controlpanel";const char NAME_CONTROLPANEL2[] = "fire_station_controlpanel2";const char OBJ_AMBULANCE01[] = "mod:Prototypes/Vehicles/01Ambulance/AMBULANCE1.e4p";const char OBJ_AMBULANCE02[] = "mod:Prototypes/Vehicles/01Ambulance/AMBULANCE1.e4p";const char OBJ_AMBULANCE04[] = "mod:Prototypes/Vehicles/01Ambulance/ALS1.e4p";const char OBJ_BATTALION[] = "mod:Prototypes/Vehicles/02 LA Fire Department/battalion_chief_vehicle.e4p";const char OBJ_USAR[] = "mod:Prototypes/Vehicles/02 LA Fire Department/usar_squad.e4p";const char OBJ_LADDER[] = "mod:Prototypes/Vehicles/01 FDNY/BOTTowerLadder.e4p";const char OBJ_TILLER[] = "mod:Prototypes/Vehicles/02 LA Fire Department/tiller_cabin.e4p";const char OBJ_RESCUE_ENGINE01[] = "mod:Prototypes/Vehicles/02 LA Fire Department/rescue_engine1.e4p";const char OBJ_ENGINE02[] = "mod:Prototypes/Vehicles/02 LA Fire Department/fire_engine2.e4p";const char OBJ_RESCUE_ENGINE02[] = "mod:Prototypes/Vehicles/02 LA Fire Department/rescue_engine2.e4p";const char OBJ_HAZMATSQUAD[] = "mod:Prototypes/Vehicles/02 LA Fire Department/hazmat_squad.e4p";const char DUMMY_GATES[] = "DummyGates";const char DUMMY_ALARM[] = "DummyDisableAlarm";const char DUMMY_CALLCREW[] = "DummyCallCrew";const char VO_BATTALION[] = "fs_battalion";const char VO_AMBULANCE01[] = "fs_ambulance01";const char VO_AMBULANCE02[] = "fs_ambulance02";const char VO_AMBULANCE03[] = "fs_ambulance03";const char VO_AMBULANCE04[] = "fs_ambulance04";const char VO_USAR[] = "fs_usar";const char VO_LADDER[] = "fs_ladder";const char VO_RESCUE_ENGINE01[] = "fs_rescue_engine01";const char VO_ENGINE02[] = "fs_engine02";const char VO_RESCUE_ENGINE02[] = "fs_rescue_engine02";const char VO_ENGINE04[] = "fs_engine04";const char VO_ENGINE05[] = "fs_engine05";const char VO_HAZMAT[] = "fs_hazmat";const char NAME_GATE01A[] = "fs_gate01a";const char NAME_GATE02A[] = "fs_gate02a";const char NAME_GATE03A[] = "fs_gate03a";const char NAME_GATE04A[] = "fs_gate04a";const char NAME_GATE05A[] = "fs_gate05a";const char NAME_GATE06A[] = "fs_gate06a";const char NAME_GATE07A[] = "fs_gate07a";const char NAME_GATE08A[] = "fs_gate08a";const char SND_ALARM[] = "mod:Audio/FX/Misc/fire_alarm.wav";const char UNNAMED[] = "Unnamed"; object VcmdStart : CommandScript{VcmdStart(){} bool CheckPossible(GameObject *Caller){return true;} bool CheckTarget(GameObject *Caller, Actor *Target, int childID){return true;} void PushActions(GameObject *Caller, Actor *Target, int ChildID){VehicleList list3("Unnamed");for(int i=0; i < list3.GetNumVehicles(); i++){Vehicle *c = list3.GetVehicle(i);c->SetSmokeLevelDuration(25.f);}  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_ALARM, AlarmSnd, true);obj->SetUserData(soundID);obj->AttachSound(soundID);}}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);Vector AlarmSnd = obj->GetPosition();int soundID = Audio::PlaySample3D(SND_ALARM, AlarmSnd, true);obj->SetUserData(soundID);obj->AttachSound(soundID);}}GameObjectList l3 = Game::GetGameObjects(NAME_CONTROLPANEL);for(int i=0; i < l3.GetNumObjects(); i++){GameObject *obj = l3.GetObject(i);obj->AssignCommand("VcmdAutoStaffOff");obj->AssignCommand("VcmdRepairVehicles"); obj->AssignCommand(DUMMY_ALARM);obj->PushActionWait(ACTION_NEWLIST, 1.5f);obj->PushActionExecuteCommand(ACTION_APPEND, DUMMY_GATES, Caller, 1, false);obj->PushActionWait(ACTION_APPEND, 16.0f);obj->PushActionExecuteCommand(ACTION_APPEND, DUMMY_ALARM, Caller, 1, false);}GameObjectList l4 = Game::GetGameObjects(NAME_CONTROLPANEL2);for(int i=0; i < l4.GetNumObjects(); i++){GameObject *obj = l4.GetObject(i);obj->AssignCommand("VcmdAutoStaffOff");obj->AssignCommand("VcmdRepairVehicles");obj->AssignCommand(DUMMY_ALARM);obj->PushActionWait(ACTION_NEWLIST, 1.5f);obj->PushActionExecuteCommand(ACTION_APPEND, DUMMY_GATES, Caller, 3, false);obj->PushActionWait(ACTION_APPEND, 16.0f);obj->PushActionExecuteCommand(ACTION_APPEND, DUMMY_ALARM, Caller, 1, false);}GameObjectList l5 = Game::GetGameObjects(NAME_FIRESTATION_ROOF);for(int i=0; i < l5.GetNumObjects(); i++){GameObject *obj = l5.GetObject(i);if(obj->GetUserData() == 0){obj->Hide();obj->SetUserData(1);}}GameObjectList l51 = Game::GetGameObjects(NAME_FIRESTATION2_ROOF);for(int i=0; i < l51.GetNumObjects(); i++){GameObject *obj = l51.GetObject(i);if(obj->GetUserData() == 0){obj->Hide();obj->SetUserData(1);}} GameObjectList gate01a = Game::GetGameObjects(NAME_GATE01A);for(int i=0; i < gate01a.GetNumObjects(); i++)GameObject *gate1 = gate01a.GetObject(i);GameObjectList gate02a = Game::GetGameObjects(NAME_GATE02A);for(int i=0; i < gate02a.GetNumObjects(); i++)GameObject *gate2 = gate02a.GetObject(i); GameObjectList gate03a = Game::GetGameObjects(NAME_GATE03A);for(int i=0; i < gate03a.GetNumObjects(); i++)GameObject *gate3 = gate03a.GetObject(i);GameObjectList gate04a = Game::GetGameObjects(NAME_GATE04A);for(int i=0; i < gate04a.GetNumObjects(); i++)GameObject *gate4 = gate04a.GetObject(i);GameObjectList gate05a = Game::GetGameObjects(NAME_GATE05A);for(int i=0; i < gate05a.GetNumObjects(); i++)GameObject *gate5 = gate05a.GetObject(i); GameObjectList gate06a = Game::GetGameObjects(NAME_GATE06A);for(int i=0; i < gate06a.GetNumObjects(); i++)GameObject *gate6 = gate06a.GetObject(i);GameObjectList gate07a = Game::GetGameObjects(NAME_GATE07A);for(int i=0; i < gate07a.GetNumObjects(); i++)GameObject *gate7 = gate07a.GetObject(i);GameObjectList gate08a = Game::GetGameObjects(NAME_GATE08A);for(int i=0; i < gate08a.GetNumObjects(); i++)GameObject *gate8 = gate08a.GetObject(i); ActorList l6 = Game::GetActors(VO_BATTALION);for(int i=0; i < l6.GetNumActors(); i++){Vector Battalion = l6.GetActor(0)->GetPosition();Vehicle m = Game::CreateVehicle(OBJ_BATTALION, UNNAMED);m.EnableBlueLights(false);m.SetPosition(Battalion);m.UpdatePlacement();m.SetMaxPassengers(2);m.SetSpeed(12.0f);m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 4, false);m.PushActionWait(ACTION_APPEND, 0.5f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);}ActorList l7 = Game::GetActors(VO_AMBULANCE01);for(int i=0; i < l7.GetNumActors(); i++){Vector Ambulance01 = l7.GetActor(0)->GetPosition();Vehicle m = Game::CreateVehicle(OBJ_AMBULANCE02, UNNAMED);m.EnableBlueLights(false);m.SetPosition(Ambulance01);m.SetRotation(gate1);m.UpdatePlacement();m.SetMaxPassengers(2);m.SetMaxTransports(1);m.SetSpeed(12.0f);m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 1, false);m.PushActionWait(ACTION_APPEND, 0.5f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 2, false);}ActorList l8 = Game::GetActors(VO_AMBULANCE02);for(int i=0; i < l8.GetNumActors(); i++){Vector Ambulance02 = l8.GetActor(0)->GetPosition();Vehicle m = Game::CreateVehicle(OBJ_AMBULANCE02, UNNAMED);m.EnableBlueLights(false);m.SetPosition(Ambulance02);m.SetRotation(gate1);m.UpdatePlacement();m.SetMaxPassengers(2);m.SetMaxTransports(1);m.SetSpeed(12.0f);m.PushActionWait(ACTION_NEWLIST, 1.0f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);m.PushActionWait(ACTION_APPEND, 0.5f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 2, false);}ActorList l9 = Game::GetActors(VO_LADDER);for(int i=0; i < l9.GetNumActors(); i++){Vector Ladder = l9.GetActor(0)->GetPosition();Vehicle m = Game::CreateVehicle(OBJ_LADDER, UNNAMED); //NOTE: Change OBJ_LADDER to OBJ_TILLER to replace the tower with the tillerm.EnableBlueLights(false);m.SetPosition(Ladder);m.SetRotation(gate3);m.UpdatePlacement();m.SetMaxPassengers(6);m.SetSpeed(9.0f);m.PushActionWait(ACTION_NEWLIST, 1.4f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);m.PushActionWait(ACTION_APPEND, 0.5f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);}ActorList l10 = Game::GetActors(VO_RESCUE_ENGINE01);for(int i=0; i < l10.GetNumActors(); i++){Vector Rescue_Engine01 = l10.GetActor(0)->GetPosition();Vehicle m = Game::CreateVehicle(OBJ_RESCUE_ENGINE01, UNNAMED);m.EnableBlueLights(false);m.SetPosition(Rescue_Engine01);m.SetRotation(gate4);m.UpdatePlacement();m.SetMaxPassengers(6);m.SetSpeed(9.0f);m.PushActionWait(ACTION_NEWLIST, 3.0f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);m.PushActionWait(ACTION_APPEND, 0.5f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);m.PushActionWait(ACTION_APPEND, 0.5f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);m.PushActionWait(ACTION_APPEND, 1.5f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);}ActorList l11 = Game::GetActors(VO_ENGINE02);for(int i=0; i < l11.GetNumActors(); i++){Vector Engine02 = l11.GetActor(0)->GetPosition();Vehicle m = Game::CreateVehicle(OBJ_ENGINE02, UNNAMED);m.EnableBlueLights(false);m.SetPosition(Engine02);m.SetRotation(gate5);m.UpdatePlacement();m.SetMaxPassengers(6);m.SetSpeed(9.0f);m.PushActionWait(ACTION_NEWLIST, 3.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, 1.5f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);}ActorList l12 = Game::GetActors(VO_USAR);for(int i=0; i < l12.GetNumActors(); i++){Vector Usar = l12.GetActor(0)->GetPosition();Vehicle m = Game::CreateVehicle(OBJ_USAR, UNNAMED);m.EnableBlueLights(false);m.SetPosition(Usar);m.SetRotation(gate2);m.UpdatePlacement();m.SetMaxPassengers(4);m.SetSpeed(9.0f);m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 6, false);m.PushActionWait(ACTION_APPEND, 0.5f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 6, false);}ActorList l13 = Game::GetActors(VO_AMBULANCE04);for(int i=0; i < l13.GetNumActors(); i++){Vector Ambulance04 = l13.GetActor(0)->GetPosition();Vehicle m = Game::CreateVehicle(OBJ_AMBULANCE04, UNNAMED);m.EnableBlueLights(false);m.SetPosition(Ambulance04);m.SetRotation(gate8);m.UpdatePlacement();m.SetMaxPassengers(2);m.SetMaxTransports(1);m.SetSpeed(12.0f);m.PushActionWait(ACTION_NEWLIST, 4.5f);//m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);//m.PushActionWait(ACTION_APPEND, 0.5f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 7, false);}ActorList l14 = Game::GetActors(VO_ENGINE05);for(int i=0; i < l14.GetNumActors(); i++){Vector Engine04 = l14.GetActor(0)->GetPosition();Vehicle m = Game::CreateVehicle(OBJ_RESCUE_ENGINE01, UNNAMED);m.EnableBlueLights(false);m.SetPosition(Engine04);m.SetRotation(gate7);m.UpdatePlacement();m.SetMaxPassengers(6);m.SetSpeed(9.0f);m.PushActionWait(ACTION_NEWLIST, 4.0f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);m.PushActionWait(ACTION_APPEND, 1.0f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);m.PushActionWait(ACTION_APPEND, 1.0f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);m.PushActionWait(ACTION_APPEND, 1.0f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);}ActorList l15 = Game::GetActors(VO_HAZMAT);for(int i=0; i < l15.GetNumActors(); i++){Vector Hazmat = l15.GetActor(0)->GetPosition();Vehicle m = Game::CreateVehicle(OBJ_HAZMATSQUAD, UNNAMED);m.EnableBlueLights(false);m.SetPosition(Hazmat);m.SetRotation(gate6);m.UpdatePlacement();m.SetMaxPassengers(4);m.SetMaxTransports(2);m.SetSpeed(8.0f);m.PushActionWait(ACTION_NEWLIST, 1.0f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 5, false);m.PushActionWait(ACTION_APPEND, 1.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);}ActorList l17 = Game::GetActors(VO_ENGINE04);for(int i=0; i < l17.GetNumActors(); i++){Vector Engine04 = l17.GetActor(0)->GetPosition();Vehicle m = Game::CreateVehicle(OBJ_ENGINE02, UNNAMED);m.EnableBlueLights(false);m.SetPosition(Engine04);m.SetRotation(gate5);m.UpdatePlacement();m.SetMaxPassengers(6);m.SetSpeed(9.0f);m.PushActionWait(ACTION_NEWLIST, 3.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, 1.5f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);}ActorList l18 = Game::GetActors(VO_AMBULANCE03);for(int i=0; i < l18.GetNumActors(); i++){Vector Ambulance03 = l18.GetActor(0)->GetPosition();Vehicle m = Game::CreateVehicle(OBJ_AMBULANCE02, UNNAMED);m.EnableBlueLights(false);            m.SetPosition(Ambulance03);m.SetRotation(gate1);m.UpdatePlacement();m.SetMaxPassengers(2);m.SetMaxTransports(1);m.SetSpeed(12.0f);m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 1, false);m.PushActionWait(ACTION_APPEND, 0.5f);m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 2, false);} System::Log("Fire stations activated!");}};

 

Link to comment
Share on other sites

There are a few problems I see. After a quick glance I've noticed that you reuse the same ambulance prototype in different constants.
 
If you want an ambulance to be considered different, it needs to have its own uniquely names prototype:
 
LAToFireStation.script

const char OBJ_AMBULANCE01[] = "mod:Prototypes/Vehicles/01Ambulance/AMBULANCE1.e4p";const char OBJ_AMBULANCE02[] = "mod:Prototypes/Vehicles/01Ambulance/AMBULANCE1.e4p";const char OBJ_AMBULANCE03[] = "mod:Prototypes/Vehicles/01Ambulance/AMBULANCE1.e4p";

As far as the game engine is concerned, AMBULANCE01, AMBULANCE02, and AMBULANCE03 are the same thing. The script uses the prototype to differentiate between vehicles:

if(StrCompare(m.GetPrototypeFileName(), OBJ_AMBULANCE01) == 0)

When returning to station, it's always going to trip on the first  if statement, meaning if you send ambulance03 back to station, it's always going to go OBJ_AMBULANCE01's spot, since OBJ_AMBULANCE03's prototype is the same as OBJ_AMBULANCE01. This is going to cause problems with most implementations.

 

I'd fix that first and see if that fixes the issue. There's probably more to fix but LA Mod based parking scripts are really hard to read, especially with no code formatting  :stupid:

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...