24.04.2012, 15:05
Код:
#define PRESSED(%0) \ (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0))) #define RELEASED(%0) \ (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0))) public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if (PRESSED(KEY_FIRE)) { if (IsPlayerInAnyVehicle(playerid)) { new component = AddVehicleComponent(GetPlayerVehicleID(playerid), 1010); } } if (RELEASED(KEY_FIRE)) { if (IsPlayerInAnyVehicle(playerid)) { RemoveVehicleComponent(GetPlayerVehicleID(playerid), component); } } return 1; }