hlmod.hu
https://hlmod.hu/

Legjobb abban a körben DHUD
https://hlmod.hu/viewtopic.php?f=9&t=15349
Oldal: 2 / 2

Szerző:  kecskee12 [ 2014.04.16. 15:16 ]
Hozzászólás témája:  Re: Legjobb abban a körben DHUD

Nem jelenik meg.. és ugy csináld kérlek ahogy leirtam :)

Szerző:  alfaanero [ 2014.04.16. 15:25 ]
Hozzászólás témája:  Re: Legjobb abban a körben DHUD

SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <hamsandwich>
  4. #include <dhudmessage>
  5. #include <cstrike>
  6.  
  7. #define PLUGIN "New Plugin"
  8. #define AUTHOR "Unknown"
  9. #define VERSION "1.0"
  10.  
  11. new g_iKills[32];
  12. new top1, top2, top3;
  13.  
  14. public plugin_init()
  15. {
  16. register_plugin(PLUGIN, VERSION, AUTHOR)
  17.  
  18. register_event("DeathMsg", "EventDeathMsg", "a")
  19. register_logevent("RoundEnd", 2, "1=Round_End")
  20. }
  21. public client_disconnect(id)
  22. {
  23. g_iKills[id] = 0;
  24. }
  25. public EventDeathMsg()
  26. {
  27. new killer = read_data(1)
  28. new victim = read_data(2)
  29.  
  30. if(killer != victim && killer && cs_get_user_team(killer) != cs_get_user_team(victim))
  31. {
  32. g_iKills[killer]++;
  33.  
  34. }
  35. else
  36. g_iKills[killer]--;
  37. }
  38. public RoundEnd()
  39. {
  40. new players[32], num;
  41. get_players(players, num);
  42. SortCustom1D(players, num, "sort_bestplayer")
  43.  
  44. top1 = players[0]
  45. top2 = players[1]
  46. top3 = players[2]
  47.  
  48. new top1neve[33], top2neve[33], top3neve[33];
  49. get_user_name(top1, top1neve, charsmax(top1neve))
  50. get_user_name(top2, top2neve, charsmax(top2neve))
  51. get_user_name(top3, top3neve, charsmax(top3neve))
  52.  
  53. if(num == 1)
  54. {
  55. set_dhudmessage(random(256), random(256), random(256), 0.29, 0.42,1,6.0,12.0,0.1,0.2)
  56. show_dhudmessage(0, "Ebben a Körben a Legjobb játékosok:^n1. %s |%d Ölés", top1neve, g_iKills[top1])
  57. }
  58. else if(num == 2)
  59. {
  60. set_dhudmessage(random(256), random(256), random(256), 0.29, 0.42,1,6.0,12.0,0.1,0.2)
  61. show_dhudmessage(0, "Ebben a Körben a Legjobb játékosok:^n1. %s |%d Ölés^n2. %s |%d Ölés", top1neve, g_iKills[top1], top2neve, g_iKills[top2])
  62. }
  63. else if(num >= 3)
  64. {
  65. set_dhudmessage(random(256), random(256), random(256), 0.29, 0.42,1,6.0,12.0,0.1,0.2)
  66. show_dhudmessage(0, "Ebben a Körben a Legjobb játékosok:^n1. %s |%d Ölés^n2. %s |%d Ölés^n3. %s |%d Ölés", top1neve, g_iKills[top1], top2neve, g_iKills[top2],top3neve, g_iKills[top3])
  67. }
  68. client_print(0, print_chat, "")
  69.  
  70. for(new i; i < 31; i++)
  71. {
  72. g_iKills[i] = 0;
  73. }
  74. }
  75.  
  76. public sort_bestplayer(id1, id2)
  77. {
  78. if(g_iKills[id1] > g_iKills[id2])
  79. return -1;
  80. else if(g_iKills[id1] < g_iKills[id2])
  81. return 1;
  82.  
  83. return 0;
  84. }
  85.  
  86. stock print_color(const id, const input[], any:...)
  87. {
  88. new count = 1, players[32]
  89. static msg[191]
  90. vformat(msg, 190, input, 3)
  91.  
  92. replace_all(msg, 190, "!g", "^4")
  93. replace_all(msg, 190, "!y", "^1")
  94. replace_all(msg, 190, "!t", "^3")
  95. replace_all(msg, 190, "á", "á")
  96. replace_all(msg, 190, "é", "Ă©")
  97. replace_all(msg, 190, "í", "Ă­")
  98. replace_all(msg, 190, "ó", "Ăł")
  99. replace_all(msg, 190, "ö", "ö")
  100. replace_all(msg, 190, "ő", "Ĺ‘")
  101. replace_all(msg, 190, "ú", "Ăş")
  102. replace_all(msg, 190, "ü", "ĂĽ")
  103. replace_all(msg, 190, "ű", "ű")
  104. replace_all(msg, 190, "Á", "Á")
  105. replace_all(msg, 190, "É", "É")
  106. replace_all(msg, 190, "Í", "ĂŤ")
  107. replace_all(msg, 190, "Ó", "Ă“")
  108. replace_all(msg, 190, "Ö", "Ă–")
  109. replace_all(msg, 190, "Ő", "Ő")
  110. replace_all(msg, 190, "Ú", "Ăš")
  111. replace_all(msg, 190, "Ü", "Ăś")
  112. replace_all(msg, 190, "Ű", "Ĺ°")
  113.  
  114. if (id) players[0] = id; else get_players(players, count, "ch")
  115. {
  116. for (new i = 0; i < count; i++)
  117. {
  118. if (is_user_connected(players[i]))
  119. {
  120. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
  121. write_byte(players[i])
  122. write_string(msg)
  123. message_end()
  124. }
  125. }
  126. }
  127. return PLUGIN_HANDLED
  128. }
  129.  

Szerző:  játékos [ 2015.10.21. 15:18 ]
Hozzászólás témája:  Re: Legjobb abban a körben DHUD

nekem csak 2-t ír ki jól a 3.at már nem :(

http://www.kepfeltoltes.eu/view.php?filename=631hud.jpg

mi lehet a hiba?

Oldal: 2 / 2 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/