Iirc, OnEntityCreated fires first before OnMapStart so precaching the model there might be already too late. Why not...
PHP Code:
public void OnEntityCreated(int entity, const char[] classname)
{
if (entity < 1 || entity > 2048)
{
return;
}
if (strcmp(classname, "weapon_ammo_spawn") == 0)
{
SDKHook(entity, SDKHook_SpawnPost, Hook_EntitySpawned);
}
}
public void Hook_EntitySpawned(int entity)
{
// I think IsValidEntity is no longer needed here since all hooks get unhooked
// automatically when the entity in question is destroyed
if (!IsModelPrecached("models/witch_bowl/bowl.mdl"))
{
PrecacheModel("models/witch_bowl/bowl.mdl");
}
SetEntityModel(entity, "models/witch_bowl/bowl.mdl");
}
?