AloneZ

Untitled

Jun 9th, 2015
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.70 KB | None | 0 0
  1. if (strcmp("/motor", cmdtext, true, 10) == 0)
  2.     {
  3.         new vehicle = GetPlayerVehicleID(playerid);
  4.         if(Gas[vehicle] <= 0)
  5.         {
  6.             NoFuel[playerid] = 1;
  7.             PlayerPlaySound(playerid, 1159, 0.0, 0.0, 0.0);
  8.             new mot, lu, alar, por, cap, porma, ob;
  9.             GetVehicleParamsEx(vehicle, mot, lu, alar, por, cap, porma, ob);
  10.             SetVehicleParamsEx(vehicle, VEHICLE_PARAMS_OFF, lu, alar, por, cap, porma, ob);
  11.             motor[playerid] = 0;
  12.             return 1;
  13.         }
  14.         new mot, lu, alar, por, cap, porma, ob;
  15.         new carro = GetPlayerVehicleID(playerid);
  16.         new playerState = GetPlayerState(playerid);
  17.         if(somligado[carro] == 1)
  18.         {
  19.              SendClientMessage(playerid, COLOR_LIGHTRED, "Você não pode ligar o motor com o sistema de som ligado neste veículo(/ligarsom para desligar)!");
  20.              return 1;
  21.         }
  22.         if(carro != INVALID_VEHICLE_ID && playerState == PLAYER_STATE_DRIVER)
  23.         {
  24.             if(motor[playerid] == 0)
  25.             {
  26.                 GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
  27.                 SetVehicleParamsEx(carro, VEHICLE_PARAMS_ON, lu, alar, por, cap, porma, ob);
  28.                 motor[playerid] = 1;
  29.                 SendClientMessage(playerid, 0xFFFFFFAA, "Veiculo {2F991A}Ligado!");
  30.             }
  31.             else{
  32.                 GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
  33.                 SetVehicleParamsEx(carro, VEHICLE_PARAMS_OFF, lu, alar, por, cap, porma, ob);
  34.                 motor[playerid] = 0;
  35.                 SendClientMessage(playerid, 0xFFFFFFAA, "Veiculo {E31919}Desligado!");
  36.             }
  37.         }
  38.         return true;
  39.     }
Advertisement
Add Comment
Please, Sign In to add comment