HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <fun>
  4. #include <hamsandwich>
  5. #include <zombieplague>
  6.  
  7. #define PLUGNAME "[ZP] Deadly Zombie"
  8. #define AUTHOR "CHyC/PomanoB"
  9. #define VERSION "4.0"
  10.  
  11. new const zclass_name[] = { "Deadly Zombi" }
  12. new const zclass_info[] = { "3x ujra eled" }
  13. new const zclass_model[] = { "zombie_source" }
  14. new const zclass_clawmodel[] = { "v_knife_zombie.mdl" }
  15. const zclass_health = 2000
  16. const zclass_speed = 250
  17. const Float:zclass_gravity = 1.0
  18. const Float:zclass_knockback = 1.0
  19.  
  20. new bool:g_end
  21.  
  22. new g_respawn_count[33]
  23.  
  24. new cvar_maxspawn , cvar_spawndelay , cvar_color , cvar_colorspawn , cvar_amount , cvar_time;
  25.  
  26. new g_zclass_respawn
  27.  
  28.  
  29. public plugin_precache()
  30. {
  31. g_zclass_respawn = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
  32. }
  33.  
  34. public plugin_init()
  35. {
  36. RegisterHam(Ham_Killed, "player", "PlayerKilled", 1);
  37. register_cvar("zp_respawn", VERSION, FCVAR_SERVER)
  38.  
  39. cvar_maxspawn = register_cvar("zp_max_spawn" , "3");
  40. cvar_spawndelay = register_cvar("zp_spawn_time" , "5.0");
  41. cvar_color = register_cvar("zp_color" , "1");
  42. cvar_colorspawn = register_cvar("zp_color_spawn" , "0 255 0");
  43. cvar_amount = register_cvar("zp_color_amount" , "30");
  44. cvar_time = register_cvar("zp_color_time" , "10.0");
  45. }
  46.  
  47. public PlayerKilled(Victim)
  48.  
  49. if (zp_get_user_zombie(Victim) && zp_get_user_zombie_class(Victim) == g_zclass_respawn && !zp_get_user_nemesis(Victim))
  50. set_task((get_pcvar_float(cvar_spawndelay)), "PlayerRespawn", Victim);
  51.  
  52. public PlayerRespawn(id)
  53. {
  54. if (g_respawn_count[id]++>=get_pcvar_num(cvar_maxspawn))
  55. return PLUGIN_CONTINUE;
  56.  
  57. if (!g_end && !is_user_alive(id) && zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_zclass_respawn && !zp_get_user_nemesis(id))
  58. {
  59. remove_task(id);
  60. zp_respawn_user(id, ZP_TEAM_ZOMBIE)
  61.  
  62.  
  63. if(get_pcvar_num(cvar_color))
  64. {
  65. new szColor[12], szRed[4], szGreen[4], szBlue[4]
  66. get_pcvar_string(cvar_colorspawn,szColor,11)
  67. parse(szColor,szRed,3,szGreen,3,szBlue,4)
  68.  
  69. new iRed = clamp(str_to_num(szRed),0,255)
  70. new iGreen = clamp(str_to_num(szGreen),0,255)
  71. new iBlue = clamp(str_to_num(szBlue),0,255)
  72.  
  73. set_user_rendering(id,kRenderFxGlowShell,iRed,iGreen,iBlue,kRenderNormal,get_pcvar_num(cvar_amount))
  74. set_task(get_pcvar_float(cvar_time),"event_time_color",id)
  75.  
  76. }
  77. }
  78. return PLUGIN_CONTINUE;
  79. }
  80.  
  81. public event_time_color(id)
  82. {
  83. set_user_rendering(id,kRenderFxNone,0,0,0,kRenderNormal,0)
  84. }
  85.  
  86. public zp_round_ended(winteam)
  87. {
  88. g_end = true
  89. }
  90.  
  91. public zp_round_started(gamemode, player)
  92. {
  93. g_end = false
  94. arrayset(g_respawn_count,0,33)
  95. }
  96. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  97. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1038\\ f0\\ fs16 \n\\ par }
  98. */
  99.