Turn the Lights on
#2

Haven't tested it, but normally it works:

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;
}
But look out! It does only work correctly in the night.
Reply


Messages In This Thread
Turn the Lights on - by HitmanEyE - 21.06.2012, 08:12
Re: Turn the Lights on - by Zerberus - 21.06.2012, 09:19

Forum Jump:


Users browsing this thread: 1 Guest(s)