HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. /*================================================================================
  2.  
  3. -------------------------------------------------
  4. -*- [ZP] Extra Item: Anti-Infection Armor 1.0 -*-
  5. -------------------------------------------------
  6.  
  7. ~~~~~~~~~~~~~~~
  8. - Description -
  9. ~~~~~~~~~~~~~~~
  10.  
  11. This item gives humans some armor that offers protection
  12. against zombie injuries.
  13.  
  14. ================================================================================*/
  15.  
  16. #include <amxmodx>
  17. #include <fakemeta>
  18. #include <zombieplague>
  19.  
  20. /*================================================================================
  21.  [Plugin Customization]
  22. =================================================================================*/
  23.  
  24. new const g_item_name[] = { "Fertozes elleni Pajzs" }
  25. const g_item_cost = 7
  26.  
  27. new const g_sound_buyarmor[] = { "items/tr_kevlar.wav" }
  28. const g_armor_amount = 150
  29. const g_armor_limit = 999
  30.  
  31. /*============================================================================*/
  32.  
  33. // Item IDs
  34. new g_itemid_humanarmor
  35.  
  36. public plugin_precache()
  37. {
  38. precache_sound(g_sound_buyarmor)
  39. }
  40.  
  41. public plugin_init()
  42. {
  43. register_plugin("[ZP] Extra: Anti-Infection Armor", "1.0", "MeRcyLeZZ")
  44.  
  45. g_itemid_humanarmor = zp_register_extra_item(g_item_name, g_item_cost, ZP_TEAM_HUMAN)
  46. }
  47.  
  48. // Human buys our upgrade, give him some armor
  49. public zp_extra_item_selected(player, itemid)
  50. {
  51. if (itemid == g_itemid_humanarmor)
  52. {
  53. set_pev(player, pev_armorvalue, float(min(pev(player, pev_armorvalue)+g_armor_amount, g_armor_limit)))
  54. engfunc(EngFunc_EmitSound, player, CHAN_BODY, g_sound_buyarmor, 1.0, ATTN_NORM, 0, PITCH_NORM)
  55. }
  56. }
  57.