Quote:
Originally Posted by OciXCrom
Hook the precache forward and return FMRES_SUPERCEDE if it's the crowbar.
@D3XT3R - stop posting mindless comments. If you don't understand, don't comment. Either way nobody understands your version of the English language.
|
That's how I did it, maybe you can look at the code.
Code:
new UnprecacheList[][] =
{
"v_crowbar.mdl",
"p_crowbar.mdl",
"w_crowbar.mdl"
}
public plugin_precache()
{
register_forward(FM_PrecacheModel, "fw_PrecacheModel")
}
public fw_PrecacheModel( const Model[] )
{
Unprecache = 0
for( new i = 0; i < sizeof( UnprecacheList ); i++ )
{
if( contain(Model, UnprecacheList[i]) != -1 )
{
Unprecache = 1
break
}
}
if( Unprecache )
{
return FMRES_SUPERCEDE
}
return FMRES_IGNORED
}
new Unprecache
Also on plugin_cfg :
Code:
public plugin_cfg()
{
engfunc( EngFunc_PrecacheModel, UMB_V_MODEL );
engfunc( EngFunc_PrecacheModel, UMB_P_MODEL );
engfunc( EngFunc_PrecacheModel, UMB_W_MODEL );
}