i have searched the forum for script to change a prop model with a custom one,i found
this,what im trying to do is to change the ammo pile model to a custom one
the code compile just fine, but the game wont load and crashes with this error :
588/ - weapon_ammo_spawn: UTIL_SetModel: not precached: models/witch_bowl/bowl.mdl
Code:
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
public OnMapStart()
{
PrecacheModel("models/witch_bowl/bowl.mdl");
}
public void OnEntityCreated(entity, const String:classname[])
{
if ( StrEqual(classname, "weapon_ammo_spawn") )
{
SDKHook(entity, SDKHook_SpawnPost, Hook_EntitySpawned);
}
}
public void Hook_EntitySpawned(entity)
{
if(IsValidEntity(entity))
{
SetEntityModel(entity, "models/witch_bowl/bowl.mdl");
}
}
__________________