any idea why the following code correctly replaces the health kits models with the halloween ones, but only the item_healthkit_full gives heath to the player?
When you walk over the small and medium ones nothing happens.
PHP Code:
#include <sourcemod>
#include <sdkhooks>
#include <sdktools>
#define MDL_KIT_FULL "models/props_halloween/pumpkin_loot.mdl"
#define MDL_KIT_MEDIUM "models/props_halloween/halloween_medkit_medium.mdl"
#define MDL_KIT_SMALL "models/props_halloween/halloween_medkit_small.mdl"
public OnPluginStart()
{
PrecacheModel(MDL_KIT_FULL, true);
PrecacheModel(MDL_KIT_MEDIUM, true);
PrecacheModel(MDL_KIT_SMALL, true);
}
public OnEntityCreated(entity, const String:classname[])
{
if(StrEqual(classname, "item_healthkit_full"))
SDKHook(entity, SDKHook_SetTransmit, OnEntitySpawned_Full);
else if(StrEqual(classname, "item_healthkit_medium"))
SDKHook(entity, SDKHook_SetTransmit, OnEntitySpawned_Medium);
else if(StrEqual(classname, "item_healthkit_small"))
SDKHook(entity, SDKHook_SetTransmit, OnEntitySpawned_Small);
}
public OnEntitySpawned_Full(entity)
{
SetEntityModel(entity, MDL_KIT_FULL);
}
public OnEntitySpawned_Medium(entity)
{
SetEntityModel(entity, MDL_KIT_MEDIUM);
}
public OnEntitySpawned_Small(entity)
{
SetEntityModel(entity, MDL_KIT_SMALL);
}
i also tried using
PHP Code:
HookEntityOutput("item_healthkit_small", "OnPlayerTouch", EntityOutput_HealthKit);
but EntityOutput_HealthKit doesn't get called