22.08.2014, 01:21
To tentando fazer mais nгo funciona.
Liga o carro quando eu aperto Y, mais quando eu aperto de novo nгo desliga, continua ligado.
Liga o carro quando eu aperto Y, mais quando eu aperto de novo nгo desliga, continua ligado.
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(IsPlayerInAnyVehicle(playerid))
{
new cont,
engine, lights, alarm, doors, bonnet, boot, objective,
vehicleid = GetPlayerVehicleID(playerid);
if(newkeys == 65536)
{
if(cont == 0)
{
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, true, lights, alarm, doors, bonnet, boot, objective);
cont = 1;
}
}
else if(newkeys == 65536)
{
if(cont == 1)
{
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, false, lights, alarm, doors, bonnet, boot, objective);
cont = 0;
}
}
}
return 1;
}