10.02.2012, 21:24
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;
}