this happens because it is a "spawner" entity, you can check what I did in my
[L4D2] Random Glow Item plugin.
I usually do this:
PHP Code:
public void OnEntityCreated(int entity, const char[] classname)
{
if (HasEntProp(entity, Prop_Data, "m_itemCount")) // *_spawn entities
{
SDKHook(entity, SDKHook_UsePost, OnUsePost);
}
}
public void OnUsePost(int entity, int activator, int caller, UseType type, float value)
{
int count = GetEntProp(entity, Prop_Data, "m_itemCount");
if (count == 0)
AcceptEntityInput(entity, "Kill");
}
__________________