Quote:
Originally Posted by hleV
You should also kill the entity
Code:
entity_set_int(Ent, EV_INT_flags, FL_KILLME);
|
Buy or pickup a primary weapon and then say "hi". Test again with SetHamReturnInteger( 0 ) and return HAM_SUPERCEDE commented out.
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
new g_iWeaponEnt;
public plugin_init()
{
RegisterHam( Ham_AddPlayerItem , "player" , "fw_HamAddPlayerItem" );
register_clcmd( "say hi" , "TestFunc" );
}
public fw_HamAddPlayerItem( id , iWeapon )
{
if( ExecuteHam( Ham_Item_ItemSlot , iWeapon ) == 1 )
{
g_iWeaponEnt = iWeapon;
client_print( id , print_chat , "Primary weapon blocked" );
SetHamReturnInteger( 0 );
return HAM_SUPERCEDE;
}
return HAM_IGNORED;
}
public TestFunc( id )
{
client_print( id , print_chat , "Weapon Exists ? %s" , pev_valid( g_iWeaponEnt ) ? "true" : "false" );
}
__________________