AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Help] UnPrecache Weapon (https://forums.alliedmods.net/showthread.php?t=295731)

DarthMan 04-03-2017 07:08

[Help] UnPrecache Weapon
 
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 !

D3XT3R 04-03-2017 07:46

Re: [Help] UnPrecache Weapon
 
just delet it from public prechase -_-

DarthMan 04-03-2017 08:02

Re: [Help] UnPrecache Weapon
 
Quote:

Originally Posted by D3XT3R (Post 2509013)
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.

OciXCrom 04-03-2017 08:55

Re: [Help] UnPrecache Weapon
 
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.

DarthMan 04-03-2017 09:08

Re: [Help] UnPrecache Weapon
 
Quote:

Originally Posted by OciXCrom (Post 2509023)
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 );
}


edon1337 04-03-2017 09:29

Re: [Help] UnPrecache Weapon
 
Use equal() not contain().

DarthMan 04-03-2017 09:34

Re: [Help] UnPrecache Weapon
 
Quote:

Originally Posted by edon1337 (Post 2509031)
Use equal() not contain().

Ty, but that still didn't work.

DeMNiX 04-03-2017 10:15

Re: [Help] UnPrecache Weapon
 
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

DarthMan 04-03-2017 10:18

Re: [Help] UnPrecache Weapon
 
Quote:

Originally Posted by DeMNiX (Post 2509043)
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 :(

DeMNiX 04-03-2017 10:23

Re: [Help] UnPrecache Weapon
 
wrote in p.m. cause i don't know have they got rules about links on otherside forums


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

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