If i remmeber correctly, hamsandwich can't retrive custom classnames which are different from engine's ones.
If you do
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <hamsandwich>
public plugin_init()
{
// This is just an example plugin
new iEnt = CreateEnt()
}
new const g_szBallClassName[] = "ball_entity"
stock CreateEnt()
{
new iEnt = create_entity("info_target")
entity_set_string(iEnt, EV_SZ_classname, g_szBallClassName)
RegisterHam(Ham_Think, "ball_entity", "fw_Think") // This will fail
RegisterHam(Ham_Think, "info_target", "fw_Think") // This would work, but you need to filter classname
RegisterHamFromEntity(Ham_Think, iEnt, "fw_Think") // Don't know if this would work, try it?
return iEnt
}
public fw_Think(iEnt)
{
// Filtering classnames ...
static szClassName[32]
entity_get_string(iEnt, EV_SZ_classname, szClassName, 31)
if(!equal(g_szBallClassName, szClassName))
{
return;
}
// Code here ...
}
__________________