whiplk

Sistema de Motor - by Willian

Sep 26th, 2011
577
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.54 KB | None | 0 0
  1. /*
  2.           Sistema de Motor By Willian_Luigi
  3.           a pedido LuizGustavo
  4.           Modo de USO: \
  5.                         Ctrl esquerdo Liga motor, CAPSLOCK liga farΓ³is
  6. */
  7. #include <a_samp>
  8.  
  9. public OnFilterScriptInit()
  10. {
  11.     print("\n===============================");
  12.     print("*******************************");
  13.     print("\nFilterScript By Willian_Luigi\n");
  14.     print("*******************************");
  15.     print("===============================\n");
  16.     return 0;
  17. }
  18.  
  19. new motor[MAX_PLAYERS], farol[MAX_PLAYERS];
  20.  
  21. public OnGameModeInit()
  22. {
  23.     ManualVehicleEngineAndLights();
  24.     return 1;
  25. }
  26.  
  27. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  28. {
  29.     if(IsPlayerInAnyVehicle(playerid) && newkeys == 1)
  30.     {
  31.         if(motor[playerid] == 0)
  32.         {
  33.             new car = GetPlayerVehicleID(playerid), wi, ll, ia, n, dlc, dmais, he;
  34.             GetVehicleParamsEx(car, wi, ll, ia, n, dlc, dmais, he);
  35.             SetVehicleParamsEx(car, VEHICLE_PARAMS_ON, ll, ia, n, dlc, dmais, he);
  36.             motor[playerid] = 1;
  37.             SendClientMessage(playerid, -1, "Motor willianV8 ligado.");
  38.             return 1;
  39.         }
  40.         else if(motor[playerid] == 1)
  41.         {
  42.             new car = GetPlayerVehicleID(playerid), wi, ll, ia, n, dlc, dmais, he;
  43.             GetVehicleParamsEx(car, wi, ll, ia, n, dlc, dmais, he);
  44.             SetVehicleParamsEx(car, VEHICLE_PARAMS_OFF, ll, ia, n, dlc, dmais, he);
  45.             motor[playerid] = 0;
  46.             SendClientMessage(playerid,-1, "Motor willianV8 desligado.");
  47.             return 1;
  48.         }
  49.         return 1;
  50.     }
  51.     if(IsPlayerInAnyVehicle(playerid) && newkeys == 2)
  52.     {
  53.         if(farol[playerid] == 0)
  54.         {
  55.             new car = GetPlayerVehicleID(playerid), wi, ll, ia, n, dlc, dmais, he;
  56.             GetVehicleParamsEx(car, wi, ll, ia, n, dlc, dmais, he);
  57.             SetVehicleParamsEx(car, wi, VEHICLE_PARAMS_ON, ia, n, dlc, dmais, he);
  58.             farol[playerid] = 1;
  59.             SendClientMessage(playerid, -1, "Farol willianShenon ligado.");
  60.             return 1;
  61.         }
  62.         else if(farol[playerid] == 1)
  63.         {
  64.             new car = GetPlayerVehicleID(playerid), wi, ll, ia, n, dlc, dmais, he;
  65.             GetVehicleParamsEx(car, wi, ll, ia, n, dlc, dmais, he);
  66.             SetVehicleParamsEx(car, wi, VEHICLE_PARAMS_OFF, ia, n, dlc, dmais, he);
  67.             farol[playerid] = 0;
  68.             SendClientMessage(playerid, -1, "Farol willianShenon desligado.");
  69.             return 1;
  70.         }
  71.         return 1;
  72.     }
  73.     return 1;
  74. }
  75.  
Advertisement
Add Comment
Please, Sign In to add comment