Raised This Month: $ Target: $400
 0% 

Model toggle help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 10-06-2006 , 07:58   Re: Model toggle help
Reply With Quote #2

Ok, here is a simple way to do it. I have a global array (set up in the same order they are for CSW_* constants) You can take this array and copy and paste and change the v_ to p_ and another for w_ so you have all three if you like, this was just an example. I gave you two ways of doing this, one through engine like you had it, and the other through FM (if you are planning on doing w_ models you need to use FM anyway)

Code:
enum {     DefModel = 0,     CSSModel } new g_szViewModels[MAX_WEAPONS][2][] = {     {"",""},     {"models/v_p228.mdl","models/CSS/v_p228.mdl"},     {"",""},     {"models/v_scout.mdl","models/CSS/v_scout.mdl"},     {"models/v_hegrenade.mdl","models/CSS/v_hegrenade.mdl"},     {"models/v_xm1014.mdl","models/CSS/v_xm1014.mdl"},     {"models/v_c4.mdl","models/CSS/v_c4.mdl"},     {"models/v_mac10.mdl","models/CSS/v_mac10.mdl"},     {"models/v_aug.mdl","models/CSS/v_aug.mdl"},     {"models/v_smokegrenade.mdl","models/CSS/v_smokegrenade.mdl"},     {"models/v_elite.mdl","models/CSS/v_elite.mdl"},     {"models/v_fiveseven.mdl","models/CSS/v_fiveseven.mdl"},     {"models/v_ump45.mdl","models/CSS/v_ump45.mdl"},     {"models/v_sg550.mdl","models/CSS/v_sg550.mdl"},     {"models/v_galil.mdl","models/CSS/v_galil.mdl"},     {"models/v_famas.mdl","models/CSS/v_famas.mdl"},     {"models/v_usp.mdl","models/CSS/v_usp.mdl"},     {"models/v_glock.mdl","models/CSS/v_glock.mdl"},     {"models/v_awp.mdl","models/CSS/v_awp.mdl"},     {"models/v_mp5.mdl","models/CSS/v_mp5.mdl"},     {"models/v_m249.mdl","models/CSS/v_m249.mdl"},     {"models/v_m3.mdl","models/CSS/v_m3.mdl"},     {"models/v_m4a1.mdl","models/CSS/v_m4a1.mdl"},     {"models/v_tmp.mdl","models/CSS/v_tmp.mdl"},     {"models/v_g3sg1.mdl","models/CSS/v_g3sg1.mdl"},     {"models/v_flashbang.mdl","models/CSS/v_flashbang.mdl"},     {"models/v_deagle.mdl","models/CSS/v_deagle.mdl"},     {"models/v_sg552.mdl","models/CSS/v_sg552.mdl"},     {"models/v_ak47.mdl","models/CSS/v_ak47.mdl"},     {"models/v_knife.mdl","models/CSS/v_knife.mdl"},     {"models/v_p90.mdl","models/CSS/v_p90.mdl"} } //..... public Event_CurWeapon(id) {     if(!is_user_alive(id))         return PLUGIN_CONTINUE             //Engine     entity_set_string(id, EV_SZ_viewmodel, g_szViewModels[read_data(2)][(hasModels[id]) ? CSSModel : DefModel] )     //FM     set_pev(id, pev_viewmodel2, g_szViewModels[read_data(2)][(hasModels[id]) ? CSSModel : DefModel] )         return PLUGIN_CONTINUE }

Last edited by Xanimos; 10-06-2006 at 08:10. Reason: Made curweapon function better.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
 



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 04:46.


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