04.12.2012, 23:12
pawn Код:
if ((newkeys == 256)) // Q para ligar o carro.
{
if (IsPlayerInAnyVehicle(playerid) && motor[playerid] == 0)
{
new mot, lu, alar, por, cap, porma, ob;
new carro = GetPlayerVehicleID(playerid);
if (carro != INVALID_VEHICLE_ID)
GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
SetVehicleParamsEx(carro, VEHICLE_PARAMS_ON, lu, alar, por, cap, porma, ob);
motor[playerid] = 1;
SendClientMessage(playerid, Branco, "Veiculo {2F991A}Ligado!");
return 1;
}
if (IsPlayerInAnyVehicle(playerid) && motor[playerid] == 1)
{
new mot, lu, alar, por, cap, porma, ob;
new carro = GetPlayerVehicleID(playerid);
if (carro != INVALID_VEHICLE_ID)
GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
SetVehicleParamsEx(carro, VEHICLE_PARAMS_OFF, lu, alar, por, cap, porma, ob);
motor[playerid] = 0;
SendClientMessage(playerid, Branco, "Veiculo {E31919}Desligado!");
return 1;
}
}