07.05.2015, 07:00
Coloque na OnPlayerKeyStateChange
PHP код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if ((newkeys & KEY_YES) && !(oldkeys & KEY_YES))
{
new vehicleid, engine,lights,alarm,doors,bonnet,boot,objective;
vehicleid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
if (vehicleid != 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(lights == 0)
{
SetVehicleParamsEx(vehicleid, engine, 1, alarm, doors, bonnet, boot, objective);
}
else
SetVehicleParamsEx(vehicleid, engine, 0, alarm, doors, bonnet, boot, objective);
}
}
}
return 1;
}