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 , 07:08   [Help] UnPrecache Weapon
Reply With Quote #1

Hello. I've been working on a weapon changer script and it works just fine, my only problem is that I don't know how to unprecache the HL1 crowbar in order to put the candy umbrella. So the weapon changes without any issues, but after I try to un-precache the defualt crowbar models, the game crashes when me or someone else joins the server.So, any ideas how to unprecache the default w, p and v models for crowbar to precache the new ones? Thanks !
DarthMan is offline
D3XT3R
AlliedModders Donor
Join Date: Nov 2016
Location: Lithuania, Bomb A (Kauna
Old 04-03-2017 , 07:46   Re: [Help] UnPrecache Weapon
Reply With Quote #2

just delet it from public prechase -_-
__________________
D3XT3R is offline
Send a message via Skype™ to D3XT3R
DarthMan
Veteran Member
Join Date: Aug 2011
Old 04-03-2017 , 08:02   Re: [Help] UnPrecache Weapon
Reply With Quote #3

Quote:
Originally Posted by D3XT3R View Post
just delet it from public prechase -_-
Nope, you didn't understand. I wan't to un-precache the default crowbar models from HL1 which are automatically precached by the game and precache the new models.
DarthMan is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-03-2017 , 08:55   Re: [Help] UnPrecache Weapon
Reply With Quote #4

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.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
DarthMan
Veteran Member
Join Date: Aug 2011
Old 04-03-2017 , 09:08   Re: [Help] UnPrecache Weapon
Reply With Quote #5

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
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 04-03-2017 , 09:29   Re: [Help] UnPrecache Weapon
Reply With Quote #6

Use equal() not contain().
__________________

Last edited by edon1337; 04-03-2017 at 09:29.
edon1337 is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 04-03-2017 , 09:34   Re: [Help] UnPrecache Weapon
Reply With Quote #7

Quote:
Originally Posted by edon1337 View Post
Use equal() not contain().
Ty, but that still didn't work.

Last edited by DarthMan; 04-03-2017 at 09:35.
DarthMan is offline
DeMNiX
Veteran Member
Join Date: Nov 2011
Location: Russia
Old 04-03-2017 , 10:15   Re: [Help] UnPrecache Weapon
Reply With Quote #8

May u try metamod module? "ultimate unprecache". Module block precache of the file and if somehow player get the model, for example, player just didn't see this model
__________________
My channel with test codes
https://www.youtube.com/user/demnix03

Zombie Riot [Scenario & bots-zombie 11.11.2023]
https://youtu.be/8ZZan-aq2sc
DeMNiX is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 04-03-2017 , 10:18   Re: [Help] UnPrecache Weapon
Reply With Quote #9

Quote:
Originally Posted by DeMNiX View Post
May u try metamod module? "ultimate unprecache". Module block precache of the file and if somehow player get the model, for example, player just didn't see this model
Found it, but sadly I still have the 512 precache limit error on a map.
The module gives a bad load error

Last edited by DarthMan; 04-03-2017 at 10:24.
DarthMan is offline
DeMNiX
Veteran Member
Join Date: Nov 2011
Location: Russia
Old 04-03-2017 , 10:23   Re: [Help] UnPrecache Weapon
Reply With Quote #10

wrote in p.m. cause i don't know have they got rules about links on otherside forums
__________________
My channel with test codes
https://www.youtube.com/user/demnix03

Zombie Riot [Scenario & bots-zombie 11.11.2023]
https://youtu.be/8ZZan-aq2sc
DeMNiX 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