21.09.2017, 15:00
Try this (not tested):
Код:
#define KEY_HANDBRAKE 128 //Right mouse button #define PRESSED(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0))) #define RELEASED(%0) (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0))) new Player_Affected_Fix[MAX_PLAYERS]; public OnPlayerDisconnect(playerid, reason) { Player_Affected_Fix[playerid] = false; return 1; } public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) { if(PRESSED(KEY_HANDBRAKE)) { if(GetPlayerWeapon(playerid) == 34) //sniper { for(new i = 0; i != MAX_PLAYER_ATTACHED_OBJECTS; i ++) RemovePlayerAttachedObject(playerid, i); Player_Affected_Fix[playerid] = true; } } else if(RELEASED(KEY_HANDBRAKE)) { if(Player_Affected_Fix[playerid]) { // Attach player objects Player_Affected_Fix[playerid] = false; } } } return 1; }