|
Author
|
Message
|
|
Senior Member
|

04-14-2021
, 14:03
Re: [L4D2] Glowing ammunition problem
|
#1
|
Quote:
Originally Posted by Marttt
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");
}
|
Thank you.
|
|
|
|