SHARE
TWEET

Weapons Refill

remusakcent Jun 2nd, 2020 765 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include < amxmodx >
  2. #include < cstrike >
  3. #include < hamsandwich >
  4.  
  5. public plugin_init()
  6.        register_plugin( "Weapons Refill", "1.0", "Radiance, Sorinel")
  7.  
  8. new const g_weapons[] = { CSW_P228, CSW_SCOUT, CSW_XM1014, CSW_MAC10, CSW_AUG, CSW_ELITE, CSW_FIVESEVEN, CSW_UMP45, CSW_SG550,  CSW_GALI, CSW_GALIL,
  9. CSW_FAMAS, CSW_USP, CSW_GLOCK18, CSW_AWP, CSW_MP5NAVY, CSW_M249, CSW_M3, CSW_M4A1, CSW_TMP, CSW_G3SG1, CSW_DEAGLE, CSW_SG552, CSW_AK47, CSW_P90 }
  10.  
  11. new const g_max_clip[] = { 13, 10, 7, 30, 30, 30, 20, 25, 30, 35,
  12. 35, 25, 12, 20, 10, 30, 100, 8, 30, 30, 20, 7, 30, 30, 50 }
  13.  
  14.  
  15. public client_death(killer, victim, wpnindex, hitplace, TK)
  16. {            
  17.     static const m_pActiveItem = 373
  18.     new ammo = get_weapon_maxclip(wpnindex)
  19.    
  20.     for (new i = 0; i < sizeof (g_weapons); i++)
  21.        
  22.     if (wpnindex == g_weapons[i])
  23.     {  
  24.         if (hitplace == HIT_HEAD)
  25.         {
  26.             if( is_user_alive(killer))
  27.             {  
  28.                 cs_set_weapon_ammo( get_pdata_cbase( killer , m_pActiveItem ) , ammo )
  29.                                 client_cmd(killer, "spk ^"items/9mmclip1.wav^"")
  30.             }
  31.         }
  32.     }
  33. }
  34.    
  35. get_weapon_maxclip(wpnid = 0) {
  36.  
  37.     for (new i = 0; i < sizeof (g_weapons); i++)
  38.         if (wpnid == g_weapons[i])
  39.             return g_max_clip[i]
  40.  
  41.     return false
  42. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top