HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3.  
  4.  
  5. #include <amxmodx>
  6.  
  7. #include <amxmisc>
  8.  
  9. #include <zombieplague>
  10.  
  11.  
  12.  
  13. #define PLUGIN "ZM Informer"
  14.  
  15. #define VERSION "1.0"
  16.  
  17. #define AUTHOR "RED"
  18.  
  19.  
  20.  
  21. new Float:g_newround_time,Float:g_roundstart_time,Float:g_freezetime,Float:g_roundtime;
  22.  
  23. new g_playtime = 1
  24.  
  25. new pcvar_roundtime, pcvar_freezetime
  26.  
  27.  
  28.  
  29. new gMaxPlayers
  30.  
  31.  
  32.  
  33. public plugin_init() {
  34.  
  35. register_plugin(PLUGIN, VERSION, AUTHOR)
  36.  
  37.  
  38.  
  39. register_event("TextMsg", "eRestart", "a", "2&#Game_C", "2&#Game_w")
  40.  
  41. register_logevent("eRoundEnd", 2, "1=Round_End")
  42.  
  43. register_event("HLTV", "eNewRound", "a", "1=0", "2=0")
  44.  
  45. register_logevent("eRoundStart", 2, "1=Round_Start")
  46.  
  47.  
  48.  
  49.  
  50.  
  51. gMaxPlayers = get_maxplayers()
  52.  
  53. pcvar_roundtime = get_cvar_pointer("mp_roundtime")
  54.  
  55. pcvar_freezetime = get_cvar_pointer("mp_freezetime")
  56.  
  57.  
  58.  
  59. set_task(1.0, "get_informer", 1, "", 0, "b")
  60.  
  61. }
  62.  
  63.  
  64.  
  65. public eRestart() {
  66.  
  67. g_playtime = 0
  68.  
  69. }
  70.  
  71. public eRoundEnd() {
  72.  
  73. g_playtime = 0
  74.  
  75. }
  76.  
  77. public eNewRound() {
  78.  
  79. g_playtime = 1
  80.  
  81.  
  82.  
  83. new Float:freezetime = get_pcvar_float(pcvar_freezetime)
  84.  
  85. if(freezetime)
  86.  
  87. {
  88.  
  89. g_newround_time = get_gametime()
  90.  
  91. g_freezetime = freezetime
  92.  
  93. }
  94.  
  95. g_roundtime = floatmul(get_pcvar_float(pcvar_roundtime), 60.0) - 1.0
  96.  
  97. }
  98.  
  99. public eRoundStart() {
  100.  
  101. g_playtime = 2
  102.  
  103. g_roundstart_time = get_gametime()
  104.  
  105. }
  106.  
  107. public get_remaining_seconds() {
  108.  
  109. if(g_playtime==2){
  110.  
  111. return floatround( g_roundtime - ( get_gametime() - g_roundstart_time ) , floatround_ceil )
  112.  
  113. }else{
  114.  
  115. return 0
  116.  
  117. }
  118.  
  119. }
  120.  
  121.  
  122.  
  123. public get_informer()
  124.  
  125. {
  126.  
  127.  
  128.  
  129. new human, timer
  130.  
  131. timer = get_remaining_seconds()
  132.  
  133. human = zp_get_human_count()
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141. for( new id = 1; id <= gMaxPlayers; id++ )
  142.  
  143. {
  144.  
  145. if(is_user_alive(id))
  146.  
  147. {
  148.  
  149. if(zp_get_user_zombie(id))
  150.  
  151. {
  152.  
  153. if(human==0){
  154.  
  155. set_hudmessage(255, 0, 0, 0.01, 0.18, 1, 1.0, 1.0)
  156.  
  157. }else{
  158.  
  159. set_hudmessage(255, 0, 0, 0.01, 0.18, 0, 1.0, 1.0)
  160.  
  161. }
  162.  
  163. show_hudmessage(id, "Zombi vagy^nElo emberek: %i", human)
  164.  
  165. }else{
  166.  
  167. if(timer<10){
  168.  
  169. set_hudmessage(0, 0, 255, 0.01, 0.18, 1, 1.0, 1.0)
  170.  
  171. }else{
  172.  
  173. set_hudmessage(0, 0, 255, 0.01, 0.18, 0, 1.0, 1.0)
  174.  
  175. }
  176.  
  177. show_hudmessage(id, "Ember vagy^nHatralevo ido: %i", timer)
  178.  
  179. }
  180.  
  181. }
  182.  
  183. }
  184.  
  185.  
  186.  
  187. }
  188.  
  189. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  190.  
  191. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
  192.  
  193. */
  194.  
  195.