Raised This Month: $ Target: $400
 0% 

[Help] UnPrecache Weapon


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DarthMan
Veteran Member
Join Date: Aug 2011
Old 04-03-2017 , 09:08   Re: [Help] UnPrecache Weapon
Reply With Quote #1

Quote:
Originally Posted by OciXCrom View Post
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 );
}
DarthMan is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:59.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode