Code:
#include <amxmodx>
#include <engine>
#include <fakemeta>
public plugin_init()
{
register_plugin("Set World Model", "0.1", "v3x");
}
public plugin_precache()
{
register_forward(FM_SetModel, "SetModel");
}
#define OLD_MODEL "models/w_m3.mdl"
#define NEW_MODEL "models/w_m3_new.mdl"
public SetModel(edict, const model[])
{
if (!is_valid_ent(edict))
return FMRES_IGNORED;
//new id = entity_get_edict(edict, EV_ENT_owner);
if(equal(model, OLD_MODEL))
{
entity_set_model(edict, NEW_MODEL);
return FMRES_SUPERCEDE;
}
return FMRES_IGNORED;
}
__________________