27.09.2012, 16:29
pawn Код:
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (PRESSED(KEY_FIRE))
{
if (IsPlayerInAnyVehicle(playerid))
{
new gpvi = GetPlayerVehicleID(playerid);
RemoveVehicleComponent(gpvi, 1010);
AddVehicleComponent(gpvi, 1010);
}
}
return 1;
}