Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /******************************************************************************************
- #Version 1.2#
- Includes: All Flashing Lights command
- - VcmdFlashingLights
- Script by Hoppah
- Usage of this script in other mods is NOT allowed without permission of Hoppah
- Edited by itchboy for PottyScotty. You owe me bruh
- ********************************************************************************************/
- int DummyGroup = 24;
- const char SND_BUTTON[] = "mod:Audio/FX/emerg_lights.wav";
- object VcmdFlashingLights : CommandScript
- {
- VcmdFlashingLights()
- {
- SetIcon("flashinglightson");
- SetCursor("flashinglights");
- SetGroupID(DummyGroup);
- SetGroupLeader(true);
- SetRestrictions(RESTRICT_SELFEXECUTE);
- }
- bool CheckPossible(GameObject *Caller)
- {
- if (!Caller->IsValid())
- return false;
- Vehicle v(Caller);
- if (v.IsBlueLightEnabled())
- SetIcon("flashinglightsoff");
- else
- SetIcon("flashinglightson");
- if (Caller->GetType() == ACTOR_VEHICLE)
- return true;
- return false;
- }
- bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
- {
- if (!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID())
- return false;
- if (Caller->GetType() == ACTOR_VEHICLE)
- return true;
- return true;
- }
- void PushActions(GameObject *Caller, Actor *Target, int childID)
- {
- Vehicle v(Caller);
- if (v.IsBlueLightEnabled())
- v.EnableBlueLights(false);
- else if (!v.IsBlueLightEnabled())
- v.EnableBlueLights(true);
- if(v.IsSpecialLightEnabled())
- {
- Game::ExecuteCommand("VcmdDirectionalLightsOff", &v, &v);
- (!v.IsBlueLightEnabled())
- v.EnableBlueLights(true);
- }
- Audio::PlaySample3D(SND_BUTTON, v.GetPosition());
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement