HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <amxmodx>
  2. #include <engine>
  3. #include <zombieplague>
  4.  
  5. #define PLUGIN "[ZP] Csapat gyozelem pont"
  6. #define VERSION "1.3"
  7. #define AUTHOR "Ryokin"
  8.  
  9. new g_zombiescore, g_humanscore, g_NoOneWin, g_hudcolor,g_hudposition , g_hudmsg
  10.  
  11. public plugin_init()
  12. {
  13. register_plugin(PLUGIN, VERSION, AUTHOR)
  14. register_think("msg","ForwardThink")
  15. register_event("TextMsg", "RestartRound", "a", "2&#Game_C", "2&#Game_w")
  16. g_NoOneWin = register_cvar( "zp_winnoone_score", "1")
  17. g_hudcolor = register_cvar( "zp_teamscore_hudcolor", "255 25 0")
  18. g_hudposition = register_cvar( "zp_teamscore_hudposition", "-1.0 0.02")
  19. g_hudmsg = CreateHudSyncObj()
  20. new iEnt = create_entity("info_target")
  21. entity_set_string(iEnt, EV_SZ_classname, "msg")
  22. entity_set_float(iEnt, EV_FL_nextthink, get_gametime() + 2.0)
  23. }
  24.  
  25. public zp_round_ended(team)
  26. {
  27. switch(team)
  28. {
  29. case WIN_ZOMBIES: g_zombiescore ++
  30.  
  31. case WIN_HUMANS: g_humanscore ++
  32.  
  33. case WIN_NO_ONE:
  34. if (get_pcvar_num(g_NoOneWin))
  35. g_humanscore ++
  36. }
  37. }
  38.  
  39. public ForwardThink(iEnt)
  40. {
  41. show_hud()
  42. entity_set_float(iEnt, EV_FL_nextthink, get_gametime() + 2.0)
  43. }
  44.  
  45. public show_hud()
  46. {
  47. static hud_red,hud_green,hud_blue, Float:hud_x, Float:hud_y
  48.  
  49. hudmsgcolor(hud_red,hud_green,hud_blue)
  50. hudmsgpos(hud_x,hud_y)
  51.  
  52. set_hudmessage(hud_red, hud_green, hud_blue, hud_x, hud_y, _, _, 4.0, _, _, 4)
  53. ShowSyncHudMsg(0, g_hudmsg, "[Zombik] - [Emberek]^n[%s%d] -- [%s%d]",g_zombiescore >= 10 ? "" : "0",g_zombiescore,g_humanscore >= 10 ? "" : "0", g_humanscore )
  54. }
  55.  
  56. public RestartRound()
  57. {
  58. g_zombiescore = 0
  59. g_humanscore = 0
  60. }
  61.  
  62. public hudmsgcolor(&hud_red,&hud_green,&hud_blue)
  63. {
  64. new color[16], red[4], green[4], blue[4]
  65. get_pcvar_string(g_hudcolor, color, 15)
  66. parse(color, red, 3, green, 3, blue, 3)
  67.  
  68. hud_red = str_to_num(red)
  69. hud_green = str_to_num(green)
  70. hud_blue = str_to_num(blue)
  71. }
  72.  
  73. public hudmsgpos(&Float:hud_x,&Float:hud_y)
  74. {
  75. new Position[19], PositionX[6], PositionY[6]
  76. get_pcvar_string(g_hudposition, Position, 18)
  77. parse(Position, PositionX, 6, PositionY, 6)
  78.  
  79. hud_x = str_to_float(PositionX)
  80. hud_y = str_to_float(PositionY)
  81. }