Carlights command
#2

Try this:

pawn Код:
#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (PRESSED(KEY_SUBMISSION/* Button 2 */) && IsPlayerInAnyVehicle(playerid)) {
        new vehicleid = GetPlayerVehicleID(playerid), turnTo;
        new engine, lights, alarm, doors, bonnet, boot, objective;
        GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
        turnTo = (lights == 0) ? (1) : (0);
        SetVehicleParamsEx(vehicleid, engine, turnTo, alarm, doors, bonnet, boot, objective);
    }
    return 1;
}
Reply


Messages In This Thread
Carlights command - by taifu - 10.02.2012, 17:47
Re: Carlights command - by Nonameman - 10.02.2012, 21:24

Forum Jump:


Users browsing this thread: 1 Guest(s)