Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <csdm>
  3. #include <cstrike>
  4. #include <fakemeta>
  5.  
  6. #define VIP_FLAG read_flags("s")
  7.  
  8. new const g_weapons[] =
  9. {
  10. CSW_P228,
  11. CSW_SCOUT,
  12. CSW_XM1014,
  13. CSW_MAC10,
  14. CSW_AUG,
  15. CSW_ELITE,
  16. CSW_FIVESEVEN,
  17. CSW_UMP45,
  18. CSW_SG550,
  19. CSW_GALI,
  20. CSW_GALIL,
  21. CSW_FAMAS,
  22. CSW_USP,
  23. CSW_GLOCK18,
  24. CSW_AWP,
  25. CSW_MP5NAVY,
  26. CSW_M249,
  27. CSW_M3,
  28. CSW_M4A1,
  29. CSW_TMP,
  30. CSW_G3SG1,
  31. CSW_DEAGLE,
  32. CSW_SG552,
  33. CSW_AK47,
  34. CSW_P90
  35. }
  36.  
  37. new const g_max_clip[] =
  38. {
  39. 13,
  40. 10,
  41. 7,
  42. 30,
  43. 30,
  44. 30,
  45. 20,
  46. 25,
  47. 30,
  48. 35,
  49. 35,
  50. 25,
  51. 12,
  52. 20,
  53. 10,
  54. 30,
  55. 100,
  56. 8,
  57. 30,
  58. 30,
  59. 20,
  60. 7,
  61. 30,
  62. 30,
  63. 50
  64. }
  65.  
  66. new const g_other_weapons[] =
  67. {
  68. CSW_KNIFE,
  69. CSW_HEGRENADE,
  70. CSW_C4
  71. }
  72.  
  73. public plugin_init()
  74. register_plugin("CSDM Refill", "1.0", "Radiance")
  75.  
  76.  
  77. public client_death(killer, victim, wpnindex, hitplace, TK)
  78. {
  79. // if (!csdm_get_ffa() && TK)
  80. // return
  81.  
  82. if(!(get_user_flags(id) & VIP_FLAG ))
  83. return
  84.  
  85. for (new a = 0; a < sizeof (g_other_weapons); a++)
  86. if (wpnindex == g_other_weapons[a])
  87. return
  88.  
  89. new weapon = fm_get_weapon_ent(killer, wpnindex)
  90.  
  91. for (new a = 0; a < sizeof (g_weapons); a++)
  92. if (wpnindex == g_weapons[a])
  93. {
  94. new ammo = get_weapon_maxclip(wpnindex)
  95.  
  96. if (ammo)
  97. {
  98. client_cmd(killer, "spk ^"items/9mmclip1.wav^"")
  99. cs_set_weapon_ammo(weapon, ammo)
  100. }
  101. return
  102.  
  103. }
  104. }
  105.  
  106. get_weapon_maxclip(wpnid = 0)
  107. {
  108. for (new a = 0; a < sizeof (g_weapons); a++)
  109. if (wpnid == g_weapons[a])
  110. return g_max_clip[a]
  111.  
  112. return false
  113. }
  114.  
  115. fm_get_weapon_ent(id, wpnid = 0)
  116. {
  117. new name[32]
  118.  
  119. if(wpnid)
  120. get_weaponname(wpnid, name, 31)
  121.  
  122. if (!equal(name, "weapon_", 7))
  123. format(name, sizeof (name) - 1, "weapon_%s", name)
  124.  
  125. return fm_find_ent_by_owner(get_maxplayers(), name, id)
  126. }
  127.  
  128. fm_find_ent_by_owner(id, const classname[], owner, jghgtype = 0)
  129. {
  130. new strtype[16] = "classname"
  131. new ent = id
  132.  
  133. switch (jghgtype)
  134. {
  135. case 1: strtype = "target"
  136. case 2: strtype = "targetname"
  137. }
  138.  
  139. while ((ent = engfunc(EngFunc_FindEntityByString, ent, strtype, classname)) && pev(ent, pev_owner) != owner)
  140. {
  141. }
  142.  
  143. return ent
  144. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement