Raised This Month: $ Target: $400
 0% 

model replacing help :S


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
haimmaik
Senior Member
Join Date: Jul 2005
Old 11-07-2005 , 10:47   model replacing help :S
Reply With Quote #1

i need a toggle that changes my weapon model and my "hands" model to hold that weapon..
now lets say i have a model of the CS hands holding claws.

now when i turn a function on... ill see my hands using claws...
and when i turn it off.. i want to see my hands using knife (normal)

how i do that???

and can i make other ppl see the change too? (like my whole body holding claws insted of knife?)
haimmaik is offline
Kensai
Veteran Member
Join Date: Aug 2005
Location: San Diego, California
Old 11-07-2005 , 11:24  
Reply With Quote #2

Try something like

EDIT: Oops, forgot reset.

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> public plugin_init()       {       register_plugin("Blah","1.0","Blah")     register_concmd("amx_claws","claws",ADMIN_KICK,"<userid> <1|0> - Sets the targeted player's claws on/off")     }   public plugin_precache()     {     precache_model("models/claws.mdl") } public claws(id,level,cid)     {         if (!cmd_access(id,level,cid,3))           return PLUGIN_HANDLED             new arg[32], arg2[32]     read_argv(1,arg,31)     read_argv(2,arg2,31)         new target=cmd_target(id,arg,4)     if(!target)         {         client_print(id,print_console,"[AMXX] Invalid Target!")         return PLUGIN_HANDLED     }         if(equali(arg2,"1"))         {         cs_set_user_model(target,"claws")         return PLUGIN_HANDLED     }     if(equali(arg2,"0"))         {         cs_reset_user_model(target)         return PLUGIN_HANDLED     }         return PLUGIN_HANDLED }
Kensai is offline
Send a message via AIM to Kensai Send a message via MSN to Kensai
haimmaik
Senior Member
Join Date: Jul 2005
Old 11-07-2005 , 11:26  
Reply With Quote #3

no dude.. it will change my player model into hands that fly in the air....
what i wanted to do is to change my hands model into other hands model and back..
i think it has something to do with entity_set_model :\ but i dont know how to use it..
haimmaik is offline
Kensai
Veteran Member
Join Date: Aug 2005
Location: San Diego, California
Old 11-07-2005 , 11:29  
Reply With Quote #4

Added the reset. That should work, unless I'm not understanding what you want.
Kensai is offline
Send a message via AIM to Kensai Send a message via MSN to Kensai
haimmaik
Senior Member
Join Date: Jul 2005
Old 11-07-2005 , 11:42  
Reply With Quote #5

in cs, every player is made out of 2 models
the man model (that every1 can see walking around)
and the hands model (that only u can see.. the ones who hold the weapon)

i want to change the hands model... not the man model...
cs_set_user_model changes the man model
haimmaik is offline
Kensai
Veteran Member
Join Date: Aug 2005
Location: San Diego, California
Old 11-07-2005 , 11:54  
Reply With Quote #6

Okay, well after looking at the Wolverine hero for SH.

I don't know how to get around the cs_set_user_model issue, but maybe something similar to this

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> public plugin_init()       {       register_plugin("Blah","1.0","Blah")       register_concmd("amx_claws","claws",ADMIN_KICK,"<userid> <1|0> - Sets the targeted player's claws on/off")       }   public plugin_precache()       {       precache_model("models/claws.mdl")   }   public claws(id,level,cid)       {           if (!cmd_access(id,level,cid,3))           return PLUGIN_HANDLED               new arg[32], arg2[32]       read_argv(1,arg,31)       read_argv(2,arg2,31)           new target=cmd_target(id,arg,4)       if(!target)           {           client_print(id,print_console,"[AMXX] Invalid Target!")           return PLUGIN_HANDLED       }           if(equali(arg2,"1"))           {           switchmodel(target)           return PLUGIN_HANDLED       }       if(equali(arg2,"0"))         {         cs_reset_user_model(target)         return PLUGIN_HANDLED     }         return PLUGIN_HANDLED   } public switchmodel(id)     {     if ( !is_user_alive(id)) return         new clip, ammo, wpnid = get_user_weapon(id,clip,ammo)     if (wpnid == CSW_KNIFE) {         cs_set_user_model(id,"models/claws.mdl")     } }
Kensai is offline
Send a message via AIM to Kensai Send a message via MSN to Kensai
haimmaik
Senior Member
Join Date: Jul 2005
Old 11-07-2005 , 12:14  
Reply With Quote #7

yep.. see.. i know how to do the function of the toggle it on and off... what i dont know is the command of removing a current model and placing another insted... its an engine thing
haimmaik is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 11-07-2005 , 14:42  
Reply With Quote #8

Code:
public plugin_precache() {     precache_model("models/chucky_knife.mdl") } public plugin_init() {     register_event("CurWeapon", "WpnMdl", "be", "1=1") } public WpnMdl(id) {     new clip, ammo, wpnid = get_user_weapon(id,clip,ammo)     if (wpnid == CSW_KNIFE) {         entity_set_string(id, EV_SZ_viewmodel, "models/chucky_knife.mdl")       } }
[ --<-@ ] Black Rose is offline
haimmaik
Senior Member
Join Date: Jul 2005
Old 11-07-2005 , 15:08  
Reply With Quote #9

thanks!
haimmaik is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 11-07-2005 , 15:22  
Reply With Quote #10

np...
[ --<-@ ] Black Rose is offline
Reply


Thread Tools
Display Modes

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 23:35.


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