Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //**********************************************************************************************************
- // #Version 2.0#
- //
- // Original script for em3 by: Rev Bem
- // Made compatible for em4 by: Godra
- // Godra's version fixed by: Hoppah
- // Script commented for easier use by: Stan
- //
- // Usage of this script in other is allowed with mention of Godra, Hoppah & Rev Bem in the readme
- //
- //**********************************************************************************************************
- int DummyGroup = 20;
- // Definitionen - Hier muss geändert werden!
- const char AlarmMessage[] = "Container afzetten."; // Die Nachricht die beim Alarm abgespielt wird
- const char AlarmSound[] = "mod:Audio/FX/Motoren/aan.wav"; // Pfad zum Sound der abgespielt wird - muss Mono & WAV sein
- object wl floadup : CommandScript
- {
- wlfloadup()
- {
- SetCursor("wlfloadup");
- SetIcon("wlfloadup");
- SetValidTargets(ACTOR_VEHICLE);
- }
- bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
- {
- if(!Caller->IsValid() || !Target->IsValid() || (Caller->GetID()==Target->GetID()))
- return false;
- Vehicle v(Target);
- //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //INFO:
- //[ENG]: Put the link to the e4p file of the container only
- //[DE]: Hier nur den link zur e4p von dem container reinschreiben
- //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- if(StrCompare(v.GetPrototypeFileName(), "mod:Prototypes/Vehicles/02Brandweer/27.e4p") == 0)
- {
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //INFO:
- //[ENG]: The "if (v.IsInstalled())" function checks if the hose conenctions are curently used
- //[DE]: Die "if (v.IsInstalled())" function checkt ob schlauch anschlusse benutzt werden
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- if (v.IsInstalled())
- return false;
- if(v.GetUserData() == 0)
- return true;
- }
- return false;
- }
- void PushActions(GameObject *Caller, Actor *Target, int childID)
- {
- Vehicle v(Caller);
- Vehicle c(Target);
- v.PushActionMove(ACTION_NEWLIST, Target, TARGET_LOADUP);
- //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //INFO:
- //[ENG]: Put the link to the e4p file of the container only
- //[DE]: Hier nur den link zur e4p von dem container reinschreiben
- //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- if(StrCompare(c.GetPrototypeFileName(), "mod:Prototypes/Vehicles/02Brandweer/27.e4p") == 0)
- {
- v.PushActionExecuteCommand(ACTION_APPEND, "DummyWLF", Target, 1, false);
- }
- }
- };
- object DummyWLF: CommandScript
- {
- DummyWLF()
- {
- }
- bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
- {
- }
- void PushActions(GameObject *Caller, Actor *Target, int childID)
- {
- Vehicle v(Caller);
- Vehicle c(Target);
- float r1, r2, r3, r4, r5, r6, r7, r8, r9;
- Vector pos = v.GetPosition();
- v.GetRotation(r1, r2, r3, r4, r5, r6, r7, r8, r9);
- Vehicle WLF;
- if(childID == 1)
- {
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //INFO:
- //[ENG]: Put the link to the e4p file of the container truck including container
- //[DE]: Hier den link zur e4p von dem container truck mit container
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- WLF = Game::CreateVehicle("mod:Prototypes/Vehicles/02Brandweer/53.e4p", "WLF1");
- }
- if(childID == 2)
- {
- WLF = Game::CreateVehicle("mod:Prototypes/Vehicles/02Brandweer/53leeg.e4p", "WLF2");
- }
- WLF.SetPosition(pos);
- WLF.SetRotation(r1, r2, r3, r4, r5, r6, r7, r8, r9);
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //INFO:
- //[ENG]: WLF.SetMaxPassengers(3); = Max units in the container truck (can change if you changed in editor)
- //[ENG]: WLF.SetSpeed(9.0f); = Vehicle speed 9.0 is egal to 90
- //[DE]: WLF.SetMaxPassengers(3); = Einheiten im container truck (kan man heir ander fals im editor geandert)
- //[DE]: WLF.SetSpeed(9.0f); = Fahrzeug speed 9.0 is gleich an 90
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- WLF.SetMaxPassengers(2);
- WLF.SetSpeed(8.0f);
- int PlayerID = v.GetPlayerMP();
- WLF.SetPlayerMP(PlayerID);
- PersonList passengers = v.GetPassengers();
- for(int i = 0; i < passengers.GetNumPersons(); i++)
- {
- v.RemovePassenger(&passengers.GetPerson(i));
- WLF.AddPassenger(&passengers.GetPerson(i));
- }
- PersonList transports = c.GetTransports();
- for(int i = 0; i < transports.GetNumPersons(); i++)
- {
- c.RemoveTransport(&transports.GetPerson(i));
- WLF.AddTransport(&transports.GetPerson(i));
- }
- v.PushActionWait(ACTION_APPEND, 0.1f);
- v.PushActionDeleteOwner(ACTION_NEWLIST);
- c.PushActionDeleteOwner(ACTION_NEWLIST);
- }
- }
- Mission::PlayHint(AlarmMessage);
- if(GameSoundID == 1)
- {
- Audio::PlaySample(AlarmSound);
- }
- Vector TargetPos=Game::GetCommandPos();
- Game::FindFreePosition(&v, TargetPos, 90);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement