Attached object bug
#4

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;
}
Reply


Messages In This Thread
Attached object bug - by Romz - 21.09.2017, 14:28
Re: Attached object bug - by adri1 - 21.09.2017, 14:42
Re: Attached object bug - by Romz - 21.09.2017, 14:46
Re: Attached object bug - by adri1 - 21.09.2017, 15:00
Re: Attached object bug - by Romz - 21.09.2017, 15:03
Re: Attached object bug - by adri1 - 21.09.2017, 15:05
Re: Attached object bug - by IstuntmanI - 21.09.2017, 15:31

Forum Jump:


Users browsing this thread: 2 Guest(s)