HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1.  
  2. #include <amxmodx>
  3. #include <amxmisc>
  4. #include <cstrike>
  5. #include <dhudmessage>
  6.  
  7. #define PLUGIN "HUD Info"
  8. #define VERSION "1.0"
  9. #define AUTHOR "N/A"
  10.  
  11. #define MAXROUNDS 40
  12.  
  13. new Rounds
  14.  
  15. new iCTKills
  16. new iTTKills
  17.  
  18. public plugin_init() {
  19. register_plugin(PLUGIN, VERSION, AUTHOR)
  20. register_event( "DeathMsg", "DeathEvent", "a" );
  21. register_event("TextMsg","ResetAll","a","2&#Game_C","2&#Game_w")
  22. register_logevent("NewRounds", 2, "0=World triggered", "1=Round_Start")
  23. set_task(1.0,"HUDInfo" , _ , _ , _ , "b")
  24. }
  25.  
  26. public ResetAll() {
  27. Rounds = 0
  28. iCTKills = 0
  29. iTTKills = 0
  30. }
  31.  
  32. public DeathEvent(){
  33. new Killer = read_data( 1 );
  34. new CsTeams:Team
  35. Team = cs_get_user_team( Killer );
  36. if (Team == CS_TEAM_T)
  37. {
  38. iTTKills++
  39. }
  40. if (Team == CS_TEAM_CT)
  41. {
  42. iCTKills++
  43. }
  44. }
  45.  
  46. public NewRounds(){
  47. Rounds++
  48. }
  49.  
  50. public HUDInfo(){
  51. new Time[9]
  52. get_time("%H:%M",Time,8)
  53.  
  54. new CurrentPlayers = get_playersnum();
  55. new MaxPlayers = get_maxplayers();
  56.  
  57. set_dhudmessage(random(255),random(255),random(255), 0.0, 0.19, 0, 6.0, 12.0)
  58. show_dhudmessage(0, "Frags of T: %d^nFrags of CT: %d^nJátékosok: %d/%d", iTTKills, iCTKills, CurrentPlayers, MaxPlayers)
  59.  
  60. }
  61.  
  62. stock print_color(const id, const input[], any:...)
  63. {
  64. new count = 1, players[32]
  65. static msg[191]
  66. vformat(msg, 190, input, 3)
  67.  
  68. replace_all(msg, 190, "!g", "^4")
  69. replace_all(msg, 190, "!y", "^1")
  70. replace_all(msg, 190, "!t", "^3")
  71. replace_all(msg, 190, "", "á")
  72. replace_all(msg, 190, "", "é")
  73. replace_all(msg, 190, "", "í")
  74. replace_all(msg, 190, "", "ó")
  75. replace_all(msg, 190, "", "ö")
  76. replace_all(msg, 190, "", "ő")
  77. replace_all(msg, 190, "", "ú")
  78. replace_all(msg, 190, "", "ü")
  79. replace_all(msg, 190, "", "ű")
  80. replace_all(msg, 190, "", "Á")
  81. replace_all(msg, 190, "", "É")
  82. replace_all(msg, 190, "", "Í")
  83. replace_all(msg, 190, "", "Ó")
  84. replace_all(msg, 190, "", "Ö")
  85. replace_all(msg, 190, "", "Ő")
  86. replace_all(msg, 190, "", "Ú")
  87. replace_all(msg, 190, "", "Ü")
  88. replace_all(msg, 190, "", "Ű")
  89.  
  90. if (id) players[0] = id; else get_players(players, count, "ch")
  91. {
  92. for (new i = 0; i < count; i++)
  93. {
  94. if (is_user_connected(players[i]))
  95. {
  96. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
  97. write_byte(players[i])
  98. write_string(msg)
  99. message_end()
  100. }
  101. }
  102. }
  103. return PLUGIN_HANDLED
  104. }
  105.