21.06.2012, 09:19
Haven't tested it, but normally it works:
But look out! It does only work correctly in the night.
pawn Код:
new lighton[MAX_PLAYERS];
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (GetPlayerVehicleSeat(playerid)==0)
{
if (newkeys & 2)
{
if(lighton[playerid] == 0)
{
new engine, alarm, doors, boot, objective;
SetVehicleParamsEx(GetPlayerVehicleID(playerid),engine, VEHICLE_PARAMS_ON, alarm, doors, bonnet, boot, objective)
lighton[playerid] = 1;
return 1;
}
else if(lighton[playerid] == 1)
{
new engine, alarm, doors, boot, objective;
SetVehicleParamsEx(GetPlayerVehicleID(playerid),engine, VEHICLE_PARAMS_OFF, alarm, doors, bonnet, boot, objective)
lighton[playerid] = 0;
return 1;
}
}
return 1;
}
return 1;
}