AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   model replacing help :S (https://forums.alliedmods.net/showthread.php?t=20372)

haimmaik 11-07-2005 10:47

model replacing help :S
 
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?)

Kensai 11-07-2005 11:24

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 }

haimmaik 11-07-2005 11:26

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..

Kensai 11-07-2005 11:29

Added the reset. That should work, unless I'm not understanding what you want.

haimmaik 11-07-2005 11:42

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

Kensai 11-07-2005 11:54

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")     } }

haimmaik 11-07-2005 12:14

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

[ --<-@ ] Black Rose 11-07-2005 14:42

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")       } }

haimmaik 11-07-2005 15:08

thanks!

[ --<-@ ] Black Rose 11-07-2005 15:22

np...


All times are GMT -4. The time now is 23:35.

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