07.01.2015, 20:41
PHP код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new vehicleid = GetPlayerVehicleID(playerid);
new engine, lights, alarm, doors, bonnet, boot, objective;
if(IsPlayerInAnyVehicle(playerid))
{
if(newkeys & KEY_YES)
{
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
if(Engine[vehicleid] == 1)
{
SetVehicleParamsEx(vehicleid, false, lights, false, doors, bonnet, boot, objective);
Engine[vehicleid] = 0;
RemovePlayerFromVehicle(playerid);
}
else if(Engine[vehicleid] == 0)
{
SendClientMessage(playerid, COLOR_GREEN, "Ligando veiculo...");
SetVehicleParamsEx(vehicleid, true, lights, false, doors, bonnet, boot, objective);
Engine[vehicleid] = 1;
}
}
}
return 1;
}