04.12.2012, 23:07
Й sу usar Uma variavel
Exemplo
Exemplo
PHP код:
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, 1, lu, alar, por, cap, porma, ob);
motor[playerid] = 1;
SendClientMessage(playerid, -1, "Veiculo {2F991A}Ligado!");
return true;
}
}
if ((newkeys == 256 )) // Q para ligar o carro.
{
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, 0, lu, alar, por, cap, porma, ob);
motor[playerid] = 0;
SendClientMessage(playerid, -1, "Veiculo {E31919}Desligado!");
return true;
}
}
if ((newkeys == 132 )) // Ctrl para Ligar o Farol.
{
if (IsPlayerInAnyVehicle(playerid) & luz[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, mot, 1, alar, por, cap, porma, ob);
luz[playerid] = 1;
SendClientMessage(playerid, -1, "Farol {2F991A}Ligado!");
return true;
}
}
if ((newkeys == 132 )) // Ctrl para Ligar o Farol.
{
if (IsPlayerInAnyVehicle(playerid) & luz[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, mot, 0, alar, por, cap, porma, ob);
luz[playerid] = 0;
SendClientMessage(playerid, -1, "Farol {E31919}Desligado!");
return true;
}
}