KAKAN

VCMP: Vehicle.KillEngine(), StartEngine(), GetEngineState()

Aug 9th, 2016
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
D 0.80 KB | None | 0 0
  1. //Create the new boolean variable. Docs: http://www.squirrel-lang.org/squirreldoc/reference/language/builtin_functions.html#class.rawnewmember
  2. CVehicle.rawnewmember("EngineState",false,null,false);
  3.  
  4. function CVehicle::KillEngine(){
  5.     //Turn the engine off.
  6.     this.SetHandlingData(13,0);
  7.     //Not sure if it works.
  8.     this.EngineState = false;
  9. }
  10.  
  11. function CVehicle::StartEngine(){
  12.     //Turn the engine on.
  13.     this.SetHandlingData(13,150);
  14.     //Change the variable to true.
  15.     this.EngineState = true;
  16. }
  17.  
  18. function CVehicle::GetEngineState(){ return this.EngineState; }
  19.  
  20. /*
  21.     * New functions with their usage:
  22.     1) vehicle.KillEngine()
  23.         @arg none
  24.         @ret null
  25.  
  26.     2) vehice.StartEngine()
  27.         @arg none
  28.         @ret null
  29.  
  30.     3) vehicle.GetEngineState()
  31.         @arg none
  32.         @ret bool
  33. */
  34. //NOTE: Untested code, might not work.
Add Comment
Please, Sign In to add comment