Raised This Month: $ Target: $400
 0% 

Where I wrong with changing on w_ models?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KiLLeR.
Senior Member
Join Date: Jul 2014
Location: Bulgaria
Old 07-26-2014 , 08:17   Where I wrong with changing on w_ models?
Reply With Quote #1

I want to change world models on grenades and try this, but didn't work. Where I wrong?
PHP Code:
register_forward(FM_SetModel"fw_SetModel");

public 
fw_SetModel(entity, const model[])
{        
    if(!
is_valid_ent(entity))
        return 
FMRES_IGNORED;
    
    if(
equal(model"models/csbg_bm/w_hegrenade.mdl"))
    {
        
entity_set_model(entity"models/csbg_bm/w_hegrenade.mdl");
        return 
FMRES_SUPERCEDE;
    }
    
    if(
equal(model"models/csbg_bm/w_flashbang.mdl"))
    {
        
entity_set_model(entity"models/csbg_bm/w_flashbang.mdl");
        return 
FMRES_SUPERCEDE;
    }
    
    if(
equal(model"models/csbg_bm/w_smokegrenade.mdl"))
    {
        
entity_set_model(entity"models/csbg_bm/w_smokegrenade.mdl");
        return 
FMRES_SUPERCEDE;
    }
    
    return 
FMRES_IGNORED;

KiLLeR. is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-26-2014 , 09:02   Re: Where I wrong with changing on w_ models?
Reply With Quote #2

Why you are checking if the grenade has your model,then you set it again ? At this point,grenades have default models, you have to check for that one.
HamletEagle is offline
KiLLeR.
Senior Member
Join Date: Jul 2014
Location: Bulgaria
Old 07-26-2014 , 09:12   Re: Where I wrong with changing on w_ models?
Reply With Quote #3

I haven't pay attention to this. Very thanks you!
Is there a need I check whether a classname is grenade?

Last edited by KiLLeR.; 07-26-2014 at 09:16.
KiLLeR. is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 07-26-2014 , 10:17   Re: Where I wrong with changing on w_ models?
Reply With Quote #4

Quote:
Originally Posted by KiLLeR. View Post
I haven't pay attention to this. Very thanks you!
Is there a need I check whether a classname is grenade?
I don't think so, since only grenades should have that model, not other entities.
klippy is offline
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 07-26-2014 , 10:35   Re: Where I wrong with changing on w_ models?
Reply With Quote #5

Use grenade_throw event to set model you want.
__________________
Finished mods:
Trouble in Terrorist Town
MurderMod
The Hidden
Cowboys vs Indians
JailBreak Supreme
Survival Madness
GuskiS is offline
KiLLeR.
Senior Member
Join Date: Jul 2014
Location: Bulgaria
Old 07-26-2014 , 11:17   Re: Where I wrong with changing on w_ models?
Reply With Quote #6

Thanks you on all, already can lock the topic!
KiLLeR. 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 13:13.


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