Advertisement
eyal282

Guard Weapons Menu

Jan 15th, 2013
446
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.77 KB | None | 0 0
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include <amxmodx>
  4. #include <amxmisc>
  5. #include <cstrike>
  6. #include <hamsandwich>
  7. #include <fakemeta_util>
  8.  
  9. #define PLUGIN "Advanced Guard Weapons"
  10. #define VERSION "1.0"
  11. #define AUTHOR "Eyal"
  12.  
  13. new Weapon[33][ 100 ], Weapon2[33][ 100 ], Gun[33][ 100 ], Gun2[33][ 100 ], M4A1[33], AK47[33], MECHINEGUN[33], SHOTGUN[33], USP[33], GLOCK[33], FIVESEVEN[33], DEAGLE[33], grenadenum[33];
  14.  
  15. public plugin_init() {
  16.     register_plugin(PLUGIN, VERSION, AUTHOR)
  17.    
  18.     RegisterHam(Ham_Spawn, "player", "FwdHamPlayerSpawn", 1)
  19. }
  20. public FwdHamPlayerSpawn(id) {
  21.     if(is_user_connected(id) && is_user_alive(id)) {
  22.     fm_strip_user_weapons(id)
  23.     fm_give_item(id, "weapon_knife")
  24.     if(cs_get_user_team(id) == CS_TEAM_CT) {
  25.     WeaponMenu(id)
  26.         }
  27.     }
  28. }
  29. public WeaponMenu(id)
  30. {
  31.     if(cs_get_user_team(id) == CS_TEAM_CT) {
  32.     new ChooseWeapon = menu_create("\r[\w Extreme Jail \r]\y Choose Your Weapon", "sub_Weapon_Choosed");
  33.     new GUN[ 100 ];                          
  34.     formatex( GUN, charsmax( GUN ), "\yWeapon -\r [\d %s \r]", Weapon[id] );
  35.     menu_additem( ChooseWeapon, GUN, "1" );
  36.     formatex( GUN, charsmax( GUN ), "\yGun -\r [\d %s \r]", Gun[id]);
  37.     menu_additem( ChooseWeapon, GUN, "2" );
  38.     formatex( GUN, charsmax( GUN ), "\yGrenade Amount -\r [\d %i \r]^n", grenadenum[id]);
  39.     menu_additem( ChooseWeapon, GUN, "3" );
  40.     formatex( GUN, charsmax( GUN ), "\yDone");
  41.     menu_additem( ChooseWeapon, GUN, "4" );
  42.    
  43.    
  44.     menu_display(id, ChooseWeapon);
  45.     }
  46.     return PLUGIN_HANDLED;
  47.     }
  48. public sub_Weapon_Choosed(id, ChooseWeapon, item)
  49. {
  50.     if(item == MENU_EXIT)
  51.         return
  52.     new data[6], iName[64]
  53.     new access, callback
  54.     menu_item_getinfo(ChooseWeapon, item, access, data, 6, iName, 63, callback)
  55.    
  56.     new key = str_to_num(data)
  57.     switch(key)
  58.     {
  59.         case 1:
  60.         {
  61.         if(M4A1[id]) {
  62.         Weapon[id] = "AK47"
  63.         Weapon2[id] = "weapon_ak47"
  64.         M4A1[id] = false
  65.         AK47[id] = true
  66.         }
  67.         else if(AK47[id]) {
  68.         Weapon[id] = "MECHINEGUN"
  69.         Weapon2[id] = "weapon_m249"
  70.         Weapon3[id] = "ammo_m249"
  71.         AK47[id] = false
  72.         MECHINEGUN[id] = true
  73.         }
  74.         else if(MECHINEGUN[id]) {
  75.         Weapon[id] = "SHOTGUN"
  76.         Weapon2[id] = "weapon_m3"
  77.         MECHINEGUN[id] = false
  78.         SHOTGUN[id] = true
  79.         }
  80.         else if(SHOTGUN[id]) {
  81.         Weapon[id] = "M4A1"
  82.         Weapon2[id] = "weapon_m4a1"
  83.         SHOTGUN[id] = false
  84.         M4A1[id] = true
  85.             }
  86.         }
  87.         case 2:
  88.         {
  89.         if(USP[id]) {
  90.         Gun[id] = "GLOCK"
  91.         Gun2[id] = "weapon_glock18"
  92.         Gun3[id] = "ammo_glock18"
  93.         USP[id] = false
  94.         GLOCK[id] = true
  95.         }
  96.         else if(GLOCK[id]) {
  97.         Gun[id] = "FIVESEVEN"
  98.         Gun2[id] = "weapon_fiveseven"
  99.         GLOCK[id] = false
  100.         FIVESEVEN[id] = true
  101.         }
  102.         else if(FIVESEVEN[id]) {
  103.         Gun[id] = "DEAGLE"
  104.         Gun2[id] = "weapon_deagle"
  105.         Gun3[id] = "ammo_deagle"
  106.         FIVESEVEN[id] = false
  107.         DEAGLE[id] = true
  108.         }
  109.         else if(DEAGLE[id]) {
  110.         Gun[id] = "USP"
  111.         Gun2[id] = "weapon_usp"
  112.         DEAGLE[id] = false
  113.         USP[id] = true
  114.             }
  115.         }
  116.         case 3:
  117.         {
  118.         if(grenadenum[id] > 1)
  119.         grenadenum[id] = 0
  120.         else
  121.         grenadenum[id]++
  122.         }
  123.         case 4:
  124.         {
  125.         GiveWeapons(id)
  126.         }
  127.         }
  128.     if(key != 4)
  129.     WeaponMenu(id)
  130. }
  131. public GiveWeapons(id)
  132. {
  133. fm_strip_user_weapons(id)
  134. fm_give_item(id, "weapon_knife")
  135. fm_give_item(id, Weapon2[id])
  136. fm_give_item(id, Gun2[id])
  137. fm_give_item(id, "weapon_hegrenade")
  138. cs_set_user_bpammo(id, CSW_HEGRENADE, grenadenum[id])
  139. if(M4A1[id])
  140. cs_set_user_bpammo(id, CSW_M4A1, 500)
  141. else if(AK47[id])
  142. cs_set_user_bpammo(id, CSW_AK47, 500)
  143. else if(MECHINEGUN[id])
  144. cs_set_user_bpammo(id, CSW_M249, 500)
  145. else if(SHOTGUN[id])
  146. cs_set_user_bpammo(id, CSW_M3, 500)
  147. if(GLOCK[id])
  148. cs_set_user_bpammo(id, CSW_GLOCK18, 500)
  149. else if(USP[id])
  150. cs_set_user_bpammo(id, CSW_GLOCK18, 500)
  151. else if(FIVESEVEN[id])
  152. cs_set_user_bpammo(id, CSW_FIVESEVEN, 500)
  153. else if(DEAGLE[id])
  154. cs_set_user_bpammo(id, CSW_DEAGLE, 500)
  155. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement