04.07.2014, 19:34
Preciso de ajuda com um fs de abrir e fechar porta malas, ele abre mais nгo fecha!!! Alguйm ajuda?
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_YES && IsPlayerInAnyVehicle(playerid))
{
new mot, lu, alar, por, cap, porma, ob;
new carro = GetPlayerVehicleID(playerid);
if(carro != INVALID_VEHICLE_ID)
if(portamalas[playerid] == 0)
{
GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
SetVehicleParamsEx(carro, mot, lu, alar, por, cap, VEHICLE_PARAMS_ON, ob);
portamalas[playerid] = 0;
SendClientMessage(playerid, Verde, "Porta malas aberto");
}
else if(portamalas[playerid] == 1)
{
GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
SetVehicleParamsEx(carro, mot, lu, alar, por, cap, VEHICLE_PARAMS_OFF, ob);
portamalas[playerid] = 0;
SendClientMessage(playerid, LARANJA, "Porta malas fechado");
}
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_YES && IsPlayerInAnyVehicle(playerid))
{
new mot, lu, alar, por, cap, porma, ob;
new carro = GetPlayerVehicleID(playerid);
if(carro != INVALID_VEHICLE_ID)
if(portamalas[playerid] == 0)
{
GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
SetVehicleParamsEx(carro, mot, lu, alar, por, cap, VEHICLE_PARAMS_ON, ob);
portamalas[playerid] = 0;
SendClientMessage(playerid, Verde, "Porta malas aberto");
}
else if(portamalas[playerid] == 1)
{
GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
SetVehicleParamsEx(carro, mot, lu, alar, por, cap, VEHICLE_PARAMS_OFF, ob);
portamalas[playerid] = 0;
SendClientMessage(playerid, LARANJA, "Porta malas fechado");
}
}