Other things can touch weapons besides a player. With register_touch you can hook only a weapon\player touch.
You can hook only one or the other of these or both:
weaponbox = dropped weapons
armoury_entity = weapons that sit on ground at map start (fy_iceworld, fy_snow etc).
PHP Code:
#include <amxmodx>
#include <engine>
public plugin_init()
{
register_touch( "weaponbox" , "player" , "WeaponTouch" );
register_touch( "armoury_entity" , "player" , "WeaponTouch" );
}
public WeaponTouch( iWeapon , iPlayer )
{
return ( /* condition */ ) ? PLUGIN_HANDLED : PLUGIN_CONTINUE;
}
__________________