AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   shield model (https://forums.alliedmods.net/showthread.php?t=27514)

vincentwind 04-23-2006 12:24

shield model
 
1 Attachment(s)
Can anyone help me ??

SSJ2GOKU 04-23-2006 15:46

1 Attachment(s)
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

organizedKaoS 04-23-2006 22:40

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

SSJ2GOKU 04-24-2006 04:05

ow sry didnt see the includes :D


All times are GMT -4. The time now is 05:13.

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