Raised This Month: $ Target: $400
 0% 

Solved [Help] Change W_Model


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DarthMan
Veteran Member
Join Date: Aug 2011
Old 04-03-2017 , 14:45   [Help] Change W_Model
Reply With Quote #1

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 !

Last edited by DarthMan; 04-15-2017 at 15:07. Reason: Solved
DarthMan is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 04-03-2017 , 16:44   Re: [Help] Change W_Model
Reply With Quote #2

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

__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 04-04-2017 , 02:48   Re: [Help] Change W_Model
Reply With Quote #3

Quote:
Originally Posted by EFFx View Post
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 is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 04-04-2017 , 03:20   Re: [Help] Change W_Model
Reply With Quote #4

I have even tried GHW_Weapon_Replacement , with no luck.
Maybe the game doesn't permit changing the model of the crowbar ?
DarthMan is offline
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 04-04-2017 , 08:09   Re: [Help] Change W_Model
Reply With Quote #5

Game?
__________________
gabuch2 is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 04-04-2017 , 08:25   Re: [Help] Change W_Model
Reply With Quote #6

Quote:
Originally Posted by Shattered Heart Lynx View Post
Game?
Half-Life 1.
DarthMan is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 04-04-2017 , 13:13   Re: [Help] Change W_Model
Reply With Quote #7

Maybe, try containi()
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-04-2017 , 18:06   Re: [Help] Change W_Model
Reply With Quote #8

Post the values for CRB_W_MODEL_OLD and UMB_W_MODEL.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-13-2017 , 15:17   Re: [Help] Change W_Model
Reply With Quote #9

Quote:
Originally Posted by OciXCrom View Post
Post the values for CRB_W_MODEL_OLD and UMB_W_MODEL.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
DarthMan
Veteran Member
Join Date: Aug 2011
Old 04-13-2017 , 17:30   Re: [Help] Change W_Model
Reply With Quote #10

Code:
new CRB_W_MODEL_OLD[] = "models/w_crowbar.mdl"
new UMB_W_MODEL[] = "models/max/w_umbrella.mdl"
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 18:04.


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