I've two plugins each of them hooking objectcaps for info_target, and its failing to call use for the first plugin in the plugin.ini list? why is that happening ?
First plugin.
PHP Code:
#define DOLL_ID 909069
#define PEV_IDENTITY pev_iuser4
public plugin_init()
{
RegisterHam(Ham_ObjectCaps, "info_target", "doll_objectcaps_pre");
}
public doll_use_post(id, caller, activator, use_type, Float:value)
{
if(pev(id, PEV_IDENTITY) != DOLL_ID)
{
return HAM_IGNORED;
}
doll_control_menu(caller, id);
return HAM_IGNORED;
}
public doll_objectcaps_pre(id)
{
if(pev(id, PEV_IDENTITY) != DOLL_ID)
{
return HAM_IGNORED;
}
SetHamReturnInteger(FCAP_IMPULSE_USE);
return HAM_OVERRIDE;
}
Second plugin.
PHP Code:
#define NPC_ID 85471
#define PEV_IDENTITY pev_iuser4
public plugin_init()
{
RegisterHam(Ham_ObjectCaps, "info_target", "npc_objectcaps_pre");
}
public npc_use_post(id, caller, activator, use_type, Float:value)
{
if(pev(id, PEV_IDENTITY) != NPC_ID || pev(id, PEV_OWNER) != caller)
{
return HAM_IGNORED;
}
new Float:fHealth;
pev(id, pev_health, fHealth);
if(fHealth <= 0.0)
{
return HAM_IGNORED;
}
pet_control_menu(caller, id);
return HAM_IGNORED;
}
public npc_objectcaps_pre(id)
{
if(pev(id, PEV_IDENTITY) != NPC_ID)
{
return HAM_IGNORED;
}
SetHamReturnInteger(FCAP_IMPULSE_USE);
return HAM_OVERRIDE;
}
__________________