Advertisement
luisgustavomiki

[INC]Controle de veículos

Apr 25th, 2011
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.43 KB | None | 0 0
  1. #include <a_samp>
  2. #include <a_vehicles>
  3.  
  4. /*////////////////////////////////////////////////////////////////////////////////
  5.  
  6.                      _ ____        _____          __  __
  7.                     (_)  _ \ ___  |_   _|__  __ _|  \/  |
  8.                     | | |_) / __|   | |/ _ \/ _` | |\/| |
  9.                     | |  __/\__ \   | |  __/ (_| | |  | |
  10.                     |_|_|   |___/   |_|\___|\__,_|_|  |_|
  11.  
  12.                         Intelligent Programming Style ®
  13.  
  14.                          ____________________________
  15.                           www.ips-team.blogspot.com
  16.                           www.ips-team.forumeiros.com
  17.                          ____________________________
  18.  
  19.                     Criado por pGibson( Luís Gustavo Miki )
  20.  
  21. */
  22.  
  23. #define ITEM_ENGINE     0
  24. #define ITEM_LIGHTS     1
  25. #define ITEM_ALARM      2
  26. #define ITEM_DOORS      3
  27. #define ITEM_BONNET     4
  28. #define ITEM_BOOT       5
  29. #define ITEM_OBJECTIVE  6
  30.  
  31. /*public OnGameModeInit()
  32. {
  33.     vehicleControlInit();
  34.     return 1;
  35. }*/
  36.  
  37. stock vehicleControlInit()
  38. {
  39.     ManualVehicleEngineAndLights();
  40.     printf("\n\n[vehicleControl by [iPs]Gibson has just loaded]\n\n");
  41.     return 1;
  42. }
  43.  
  44. stock getVehicleStats( vehicleid , item )
  45. {
  46.     new _engine, // Motor
  47.         _lights, // Luzes
  48.         _alarm,  // Alarme
  49.         _doors,  // Portas
  50.         _bonnet, // Capô
  51.         _boot,   // Porta malas
  52.         _objective; // Objetivo ( Seta Indicando Objetivo )
  53.  
  54.     GetVehicleParamsEx(vehicleid, _engine, _lights, _alarm, _doors, _bonnet, _boot, _objective);
  55.  
  56.     if( item == ITEM_ENGINE     )   return _engine;
  57.     if( item == ITEM_LIGHTS     )   return _lights;
  58.     if( item == ITEM_ALARM      )   return _alarm;
  59.     if( item == ITEM_DOORS      )   return _doors;
  60.     if( item == ITEM_BONNET     )   return _bonnet;
  61.     if( item == ITEM_BOOT       )   return _boot;
  62.     if( item == ITEM_OBJECTIVE  )   return _objective;
  63. }
  64.  
  65. stock setVehicleStats( vehicleid , item , bool:stat = true )
  66. {
  67.     new _engine, // Motor
  68.         _lights, // Luzes
  69.         _alarm,  // Alarme
  70.         _doors,  // Portas
  71.         _bonnet, // Capô
  72.         _boot,   // Porta malas
  73.         _objective; // Objetivo ( Seta Indicando Objetivo )
  74.  
  75.     GetVehicleParamsEx(vehicleid, _engine, _lights, _alarm, _doors, _bonnet, _boot, _objective);
  76.     if( stat )
  77.     {
  78.         if( item == ITEM_ENGINE     ) _engine       = true;
  79.         if( item == ITEM_LIGHTS     ) _lights       = true;
  80.         if( item == ITEM_ALARM      ) _alarm        = true;
  81.         if( item == ITEM_DOORS      ) _doors        = true;
  82.         if( item == ITEM_BONNET     ) _bonnet       = true;
  83.         if( item == ITEM_BOOT       ) _boot         = true;
  84.         if( item == ITEM_OBJECTIVE  ) _objective    = true;
  85.         SetVehicleParamsEx(vehicleid, _engine, _lights, _alarm, _doors, _bonnet, _boot, _objective);
  86.         return 1;
  87.     }
  88.     else
  89.     {
  90.         if( item == ITEM_ENGINE     ) _engine       = false;
  91.         if( item == ITEM_LIGHTS     ) _lights       = false;
  92.         if( item == ITEM_ALARM      ) _alarm        = false;
  93.         if( item == ITEM_DOORS      ) _doors        = false;
  94.         if( item == ITEM_BONNET     ) _bonnet       = false;
  95.         if( item == ITEM_BOOT       ) _boot         = false;
  96.         if( item == ITEM_OBJECTIVE  ) _objective    = false;
  97.         SetVehicleParamsEx(vehicleid, _engine, _lights, _alarm, _doors, _bonnet, _boot, _objective);
  98.         return 0;
  99.     }
  100. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement