HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <amxmodx>
  2. #include <fakemeta>
  3. #include <zombieplague>
  4.  
  5. new g_maxplayers, cvar_plaguenemhpmulti, cvar_plaguesurvhpmulti
  6.  
  7. public plugin_init()
  8. {
  9. // This addon makes Plague rounds be 50% nemesis and 50% survivors
  10. // REQUIRES ZP version 4.3-beta1 or later
  11. register_plugin("[ZP] 50-50 Plague Mode", "0.2", "MeRcyLeZZ")
  12.  
  13. g_maxplayers = get_maxplayers()
  14. }
  15.  
  16. public plugin_cfg()
  17. {
  18. cvar_plaguenemhpmulti = get_cvar_pointer("zp_plague_nem_hp_multi")
  19. cvar_plaguesurvhpmulti = get_cvar_pointer("zp_plague_surv_hp_multi")
  20. }
  21.  
  22. public zp_round_started(gamemode)
  23. {
  24. // Plague mode only
  25. if (gamemode != MODE_PLAGUE)
  26. return;
  27.  
  28. static id
  29. for (id = 1; id <= g_maxplayers; id++)
  30. {
  31. // Dead or already a nemesis/survivor
  32. if (!is_user_alive(id) || zp_get_user_nemesis(id) || zp_get_user_survivor(id))
  33. continue;
  34.  
  35. if (zp_get_user_zombie(id))
  36. {
  37. // Turn zombies into Nemesis
  38. zp_make_user_nemesis(id)
  39.  
  40. // Apply nemesis health multiplier
  41. set_pev(id, pev_health, float(pev(id, pev_health))*get_pcvar_float(cvar_plaguenemhpmulti))
  42. }
  43. else
  44. {
  45. // Turn humans into Survivors
  46. zp_make_user_survivor(id)
  47.  
  48. // Apply survivor health multiplier
  49. set_pev(id, pev_health, float(pev(id, pev_health))*get_pcvar_float(cvar_plaguesurvhpmulti))
  50. }
  51. }
  52. }
  53.