AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved [Help] Change W_Model (https://forums.alliedmods.net/showthread.php?t=295751)

DarthMan 04-03-2017 14:45

[Help] Change W_Model
 
Hello. How can I change the w_ model for all existing crowbars on the map?
My friend did a small change to my code, still it doesn't work.
Here it is :

Code:

public fw_SetModel(entity, model[])
{
        if(!is_valid_ent(entity))
            return FMRES_IGNORED

        new xModel[64];
        entity_get_string(entity, EV_SZ_model, xModel, charsmax(xModel))

        if(equal(xModel,CRB_W_MODEL_OLD))
        {
            entity_set_model(entity, UMB_W_MODEL)
            return FMRES_SUPERCEDE
        }
        return FMRES_IGNORED
}

For v_ and p_ it works just fine, any ideas?
Thanks !

EFFx 04-03-2017 16:44

Re: [Help] Change W_Model
 
PHP Code:

public fw_SetModel(entitymodel[])
{
        if(!
is_valid_ent(entity)) 
            return 
FMRES_IGNORED

        
if(equal(model,CRB_W_MODEL_OLD))
        {
            
engfunc(EngFunc_SetModelentUMB_W_MODEL)
            return 
FMRES_SUPERCEDE
        
}
        return 
FMRES_IGNORED



DarthMan 04-04-2017 02:48

Re: [Help] Change W_Model
 
Quote:

Originally Posted by EFFx (Post 2509132)
PHP Code:

public fw_SetModel(entitymodel[])
{
        if(!
is_valid_ent(entity)) 
            return 
FMRES_IGNORED

        
if(equal(model,CRB_W_MODEL_OLD))
        {
            
engfunc(EngFunc_SetModelentUMB_W_MODEL)
            return 
FMRES_SUPERCEDE
        
}
        return 
FMRES_IGNORED



It doesn't work, I still see the default crowbar model :(

DarthMan 04-04-2017 03:20

Re: [Help] Change W_Model
 
I have even tried GHW_Weapon_Replacement , with no luck.
Maybe the game doesn't permit changing the model of the crowbar ?

gabuch2 04-04-2017 08:09

Re: [Help] Change W_Model
 
Game?

DarthMan 04-04-2017 08:25

Re: [Help] Change W_Model
 
Quote:

Originally Posted by Shattered Heart Lynx (Post 2509233)
Game?

Half-Life 1.

EFFx 04-04-2017 13:13

Re: [Help] Change W_Model
 
Maybe, try containi()

OciXCrom 04-04-2017 18:06

Re: [Help] Change W_Model
 
Post the values for CRB_W_MODEL_OLD and UMB_W_MODEL.

CrazY. 04-04-2017 19:08

Re: [Help] Change W_Model
 
https://forums.alliedmods.net/showthread.php?t=40822

Natsheh 04-04-2017 19:45

Re: [Help] Change W_Model
 
Hook thier spawn pre check if it has no owner then change the model!

And are you hooking set model pre or post?


All times are GMT -4. The time now is 18:04.

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