Raised This Month: $ Target: $400
 0% 

shield model


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
vincentwind
Junior Member
Join Date: Apr 2006
Old 04-23-2006 , 12:24   shield model
Reply With Quote #1

Can anyone help me ??
Attached Files
File Type: sma Get Plugin or Get Source (amx_shieldmodel.sma - 432 views - 4.1 KB)
vincentwind is offline
SSJ2GOKU
Senior Member
Join Date: Oct 2005
Location: Belgium
Old 04-23-2006 , 15:46  
Reply With Quote #2

errr
why do you put an switch structure if you do 3 times the same thing ?
i see no difference in the models you put in each case part ?

Code:
  // Weapon ID, Ammo, Clip   new clip, ammo, wpnid = get_user_weapon(id,clip,ammo)
you dont need the "clip, ammo" because it also works alone with "id"
Code:
  // Team   new team = cs_get_user_shield(id);
that wont work because it returns 1 or 0, just 1 if you are carrying a shield and 0 if you dont


Code:
if (wpnid == SHIELD)
that wont work because wpnid is an integer and not a word

-------------------------
added a fixed plugin (above errors), didnt have teh time to test it out
Attached Files
File Type: sma Get Plugin or Get Source (amx_shieldmodel.sma - 249 views - 4.4 KB)
SSJ2GOKU is offline
Send a message via MSN to SSJ2GOKU
organizedKaoS
Senior Member
Join Date: Feb 2006
Old 04-23-2006 , 22:40  
Reply With Quote #3

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <engine> public plugin_init()     {     // Plugin information     register_plugin("Teamdeagles","0.1","Ywa-NL")     register_event("CurWeapon", "weaponChange", "be", "1=1")     register_cvar("amx_teamdeagles", "1")         return PLUGIN_CONTINUE } public plugin_precache()     {     // Precache models     precache_model("models/topsever1/shield/v_shield_deagle.mdl")     precache_model("models/topsever1/shield/v_shield_fiveseven.mdl")       precache_model("models/topsever1/shield/v_shield_flashbang.mdl")     precache_model("models/topsever1/shield/v_shield_glock18.mdl")     precache_model("models/topsever1/shield/v_shield_hegrenade.mdl")     precache_model("models/topsever1/shield/v_shield_knife.mdl")     precache_model("models/topsever1/shield/v_shield_p228.mdl")     precache_model("models/topsever1/shield/v_shield_smokegrenade.mdl")     precache_model("models/topsever1/shield/v_shield_usp.mdl")       return PLUGIN_CONTINUE } public weaponChange(id)         {     if ( !get_cvar_num("amx_teamdeagles") )         return PLUGIN_CONTINUE         new weapid = read_data(2)       new shield = cs_get_user_shield(id)         if(shield)         {         switch(weapid)         {             case 1: //P228             {                   entity_set_string(id, EV_SZ_viewmodel,"models/topsever1/shield/v_shield_p228.mdl")                          }             case 4: //HE             {                   entity_set_string(id, EV_SZ_viewmodel,"models/topsever1/shield/v_shield_hegrenade.mdl")             }             case 9: //Smoke             {                         entity_set_string(id, EV_SZ_viewmodel,"models/topsever1/shield/v_shield_smokegrenade.mdl")                          }             case 11://5-7             {                 entity_set_string(id, EV_SZ_viewmodel, "models/topsever1/shield/v_shield_fiveseven.mdl")             }             case 16://USP             {                 entity_set_string(id, EV_SZ_viewmodel,"models/topsever1/shield/v_shield_usp.mdl")             }             case 17://Glock             {                 entity_set_string(id, EV_SZ_viewmodel,"models/topsever1/shield/v_shield_glock18.mdl")             }             case 29://Knife             {                 entity_set_string(id, EV_SZ_weaponmodel,"models/topsever1/shield/v_shield_knife.mdl")             }         }     }       return PLUGIN_CONTINUE   }

Compiled with no errors ( 1.71 ), not tested.

PS: GOKU, you used cs_get_user_team(id) without including cstrike in the plugin, wont work.
organizedKaoS is offline
SSJ2GOKU
Senior Member
Join Date: Oct 2005
Location: Belgium
Old 04-24-2006 , 04:05  
Reply With Quote #4

ow sry didnt see the includes
SSJ2GOKU is offline
Send a message via MSN to SSJ2GOKU
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 05:13.


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