Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. object WWTDOn : CommandScript
  2. {
  3. WWTDOn()
  4. {
  5. SetIcon("floodlightson");
  6. SetCursor("lighton");
  7. SetGroupLeader(true);
  8. SetRestrictions(RESTRICT_SELFEXECUTE);
  9. SetPriority(100);
  10. }
  11.  
  12. bool CheckPossible(GameObject *Caller)
  13. {
  14. if (!Caller->IsValid())
  15. return false;
  16.  
  17. if (Caller->GetType() == ACTOR_VEHICLE)
  18. return true;
  19.  
  20. return false;
  21. }
  22.  
  23. bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
  24. {
  25. if (!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID())
  26. return false;
  27.  
  28. if (Caller->GetType() == ACTOR_VEHICLE)
  29. return true;
  30.  
  31. return true;
  32. }
  33.  
  34. void PushActions(GameObject *Caller, Actor *Target, int childID)
  35. {
  36. Vehicle v(Caller);
  37. v.EnableTrafficLight(TLT_YELLOW);
  38. v.AssignCommand(CMD_WWTD_OFF);
  39. v.RemoveCommand(CMD_WWTD_ON);
  40. Audio::PlaySample3D(SND_TOGGLE, v.GetPosition());
  41. }
  42. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement