Code:
#define is_valid_player(%1) (1 <= %1 <= 32)
This is
NOT a validity check, this is just an out of bounds check for a player index.
This is a real validity check you should use:
Code:
stock bool:is_valid_player( id )
{
return ( pev_valid(id) && (id >= 1) && (id <= g_MaxPlayers) && is_user_connected(id) && !is_user_hltv(id) );
}
Line 207 of your code:
Code:
if ( is_valid_player( attacker ) && get_user_weapon(attacker) == CSW_M4A1 && g_HasM4A1[attacker] )
g_HasM4A1 is an undefined variable in your code , which I don't think you need since
get_user_weapon()
already checks if the player has this weapon. Remove it from your code:
Code:
if ( is_valid_player( attacker ) && (get_user_weapon(attacker) == CSW_M4A1) )
__________________