The code below hooks OutValue of all math_counter entities:
Code:
public void OnPluginStart()
{
HookEntityOutput("math_counter", "OutValue", OnDamageCounter);
}
public void OnDamageCounter(const char[] output, int caller, int activator, float delay)
{
float flMaxParam = GetEntPropFloat(caller, Prop_Data, "m_flMax");
}
It works fine, but it appears that it also hooks trigger_multiple sometimes.
Quote:
L 05/15/2020 - 01:48:11: [SM] Exception reported: Property "m_flMax" not found (entity 259/trigger_multiple)
L 05/15/2020 - 01:48:11: [SM] Blaming: showdamage.smx
L 05/15/2020 - 01:48:11: [SM] Call stack trace:
L 05/15/2020 - 01:48:11: [SM] [0] GetEntPropFloat
L 05/15/2020 - 01:48:11: [SM] [1] Line 52, showdamage.sp::OnDamageCounter
|
how can I prevent that without comparing the classnames?