Thanks to
AdRiAnIlloOs help, I managed to get this code to work:
PHP Code:
public void OnPluginStart()
{
HookEntityOutput("mapvetopick_controller", "OnSidesPicked", Entity_VetoController_OnSidesPicked);
}
public void Entity_VetoController_OnSidesPicked(const char[] output, int caller, int activator, float delay)
{
int switchSides = GetEntProp(caller, Prop_Data, "m_OnSidesPicked");
}
This does not work for every entity output, tho! The maximum size of GetEntProp() is 1 cell (4 bytes), but most members of COutputVariant are 24 bytes long. If you try to use math_counter::m_OutValue for example, SourceMod is going to throw an exception. The solution is to use GetEntData() like in this example AdRiAnIlloO provided me with:
PHP Code:
#include <sdktools_entoutput>
public void OnMapStart()
{
HookEntityOutput("math_counter", "OutValue", OnMathCounterOutValue);
}
void OnMathCounterOutValue(const char[] output, int caller, int activator, float delay)
{
float value = GetEntDataFloat(caller, FindDataMapInfo(caller, "m_OutValue"));
PrintToServer("OnMathCounterOutValue called. New value = %f.", value);
}
GetEntData() performs no strict checking like GetEntProp() so it's less save to use but gets the job done.
Apparently there has been an attempt by the devs to also make it work with GetEntProp():
https://forums.alliedmods.net/showpo...5&postcount=16
But this has never made it to the stable branches.