I'm trying to create entites by calling CREATE_NAMED_ENTITY, due to the old story with dll optimizations and the hash list not being updated when creating an entity with amxx.
So, I managed to properly hook(
orpheu config shows "FOUND") that function:
Code:
new OrpheuFunction: CreateNamedEntityHook
public plugin_precache()
{
CreateNamedEntityHook = OrpheuGetFunction("CREATE_NAMED_ENTITY")
if(!CreateNamedEntityHook)
{
set_fail_state("Failed to hook CREATE_NAMED_ENTITY")
}
}
//Later
OrpheuCall(CreateNamedEntityHook, EntityClassName)
The problem is that everytime I call that function it returns an invalid entity(0). I'm sure that EntityClassName is a valid string, I've tried with
info_target
I'm a bit confused because in IDA I see that this function has a singe param and that's an int, but the classname should be a string.
Also the game code didn't solved my questions:
Code:
edict_t *CREATE_NAMED_ENTITY(string_t iClass)
{
edict_t *named = g_engfuncs.pfnCreateNamedEntity(iClass);
if (named)
{
AddEntityHashValue(&named->v, STRING(iClass), CLASSNAME);
}
return named;
}
__________________