Raised This Month: $ Target: $400
 0% 

fw_setmodel cant detect a model


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
avril-lavigne
Banned
Join Date: Apr 2009
Old 01-13-2014 , 05:06   fw_setmodel cant detect a model
Reply With Quote #1

Code:
public StartKamikadze()
{
    activated = 2
    forw = register_forward(FM_SetModel,"fw_setmodel"); //register it just for gameplay #2
}


public fw_setmodel(ent,model[])
 {
    client_print(0,3,"DEBUG : activated MODE IS %d", activated) //this is called with any weapon drop/buy
  
    if(equali(model,"models/backpack.mdl"))
    {
        client_print(0 , 3 ,"DEBUG : activated MODEL BACKPACK FOUND")  // THIS IS NOT CALLED
        engfunc( EngFunc_SetModel, ent , invis_c4 );
        return FMRES_SUPERCEDE;
    }

     if(equali(model,"models/w_c4.mdl"))
    {
        client_print(0,3,"DEBUG : activated MODEL w_c4 FOUND")   // THIS IS NOT CALLED
        engfunc( EngFunc_SetModel, ent , invis_c4 );
        return FMRES_SUPERCEDE;
    }

    return FMRES_IGNORED;
}
so the function is called
but if (equali ( model = NOT . I need to make backpack.mdl invisible so the others cant see who carries the bomb )
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc

Last edited by avril-lavigne; 01-13-2014 at 05:07.
avril-lavigne is offline
DavidJr
Senior Member
Join Date: Apr 2012
Old 01-13-2014 , 05:42   Re: fw_setmodel cant detect a model
Reply With Quote #2

PHP Code:
if(equali(model,"models/backpack.mdl"))
    {
        
client_print(,"DEBUG : activated MODEL BACKPACK FOUND")  // THIS IS NOT CALLED
        
engfuncEngFunc_SetModelent invis_c4 );
        return 
FMRES_SUPERCEDE;
    } 
change models/backpack.mdl to models/w_backpack.mdl

also c4 model will be set to backpack if it is dropped.

Anyway, try to check if the entity is valid
__________________
What are you looking for here?

Last edited by DavidJr; 01-13-2014 at 05:43.
DavidJr is offline
avril-lavigne
Banned
Join Date: Apr 2009
Old 01-13-2014 , 05:48   Re: fw_setmodel cant detect a model
Reply With Quote #3

Yes w_backpack works thank you. but I want to change it on terrorist`s back .

the model still looks like backpack on terrorists back. but on the ground it changes corectly
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc
avril-lavigne is offline
DavidJr
Senior Member
Join Date: Apr 2012
Old 01-13-2014 , 05:52   Re: fw_setmodel cant detect a model
Reply With Quote #4

Because backpack on player models is submodel of player model.

[IMG]http://imagizer.**************/v2/800x600q90/9/spf0.jpg[/IMG]
__________________
What are you looking for here?
DavidJr is offline
avril-lavigne
Banned
Join Date: Apr 2009
Old 01-13-2014 , 06:04   Re: fw_setmodel cant detect a model
Reply With Quote #5

ok

/* Sets the submodel setting of the player.
* If this is 1, then the user has a backpack or defuser on their model (depending on team)
* 0 removes it.
*/
native cs_set_user_submodel(index, value);
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc
avril-lavigne is offline
DavidJr
Senior Member
Join Date: Apr 2012
Old 01-13-2014 , 06:51   Re: fw_setmodel cant detect a model
Reply With Quote #6

I usually use set_pev(id, pev_body, the value);
__________________
What are you looking for here?
DavidJr is offline
avril-lavigne
Banned
Join Date: Apr 2009
Old 01-13-2014 , 06:55   Re: fw_setmodel cant detect a model
Reply With Quote #7

entity_set_int(player1, EV_INT_body, 0) do the same i think

need more testing.
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc

Last edited by avril-lavigne; 01-13-2014 at 07:03.
avril-lavigne is offline
DavidJr
Senior Member
Join Date: Apr 2012
Old 01-13-2014 , 07:03   Re: fw_setmodel cant detect a model
Reply With Quote #8

What are you actually gonna do?
__________________
What are you looking for here?
DavidJr is offline
avril-lavigne
Banned
Join Date: Apr 2009
Old 01-13-2014 , 07:08   Re: fw_setmodel cant detect a model
Reply With Quote #9

no its done, thank you for help

backpack is invisible when T has the bomb
Spoiler
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc

Last edited by avril-lavigne; 01-13-2014 at 07:08.
avril-lavigne 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 10:13.


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