hlmod.hu
https://hlmod.hu/

Öléseid, halálaid bele írása (egyszerü kérés)
https://hlmod.hu/viewtopic.php?f=29&t=20664
Oldal: 1 / 1

Szerző:  krisztian2 [ 2015.05.12. 15:53 ]
Hozzászólás témája:  Öléseid, halálaid bele írása (egyszerü kérés)

Hali, azt szeretném ha vki bele írná az öléseim: Halálaim: hudot aki megcsinálja megy a pacsi.
SMA Forráskód: [ Mindet kijelol ]
  1.  
  2.  
  3. #include <amxmodx>
  4. #include <amxmisc>
  5. #include <cstrike>
  6. #include <dhudmessage>
  7.  
  8. #define PLUGIN "HUD Info"
  9. #define VERSION "1.0"
  10. #define AUTHOR "N/A"
  11.  
  12. #define MAXROUNDS 40
  13.  
  14. new Rounds
  15.  
  16. new iCTKills
  17. new iTTKills
  18.  
  19. public plugin_init() {
  20. register_plugin(PLUGIN, VERSION, AUTHOR)
  21. register_event( "DeathMsg", "DeathEvent", "a" );
  22. register_event("TextMsg","ResetAll","a","2&#Game_C","2&#Game_w")
  23. register_logevent("NewRounds", 2, "0=World triggered", "1=Round_Start")
  24. set_task(1.0,"HUDInfo" , _ , _ , _ , "b")
  25. }
  26.  
  27. public ResetAll() {
  28. Rounds = 0
  29. iCTKills = 0
  30. iTTKills = 0
  31. }
  32.  
  33. public DeathEvent(){
  34. new Killer = read_data( 1 );
  35. new CsTeams:Team
  36. Team = cs_get_user_team( Killer );
  37. if (Team == CS_TEAM_T)
  38. {
  39. iTTKills++
  40. }
  41. if (Team == CS_TEAM_CT)
  42. {
  43. iCTKills++
  44. }
  45. }
  46.  
  47. public NewRounds(){
  48. Rounds++
  49. }
  50.  
  51. public HUDInfo(){
  52. new Time[9]
  53. get_time("%H:%M",Time,8)
  54.  
  55. new CurrentPlayers = get_playersnum();
  56. new MaxPlayers = get_maxplayers();
  57.  
  58.  
  59. set_dhudmessage(random(255),random(255),random(255), 0.0, 0.19, 0, 6.0, 12.0)
  60. show_dhudmessage(0, "T állás: %d^nCT állás: %d^nÖléseid: [%d] Halálaid: [%d]", iTTKills, iCTKills,)
  61.  
  62. }
  63.  
  64. stock print_color(const id, const input[], any:...)
  65. {
  66. new count = 1, players[32]
  67. static msg[191]
  68. vformat(msg, 190, input, 3)
  69.  
  70. replace_all(msg, 190, "!g", "^4")
  71. replace_all(msg, 190, "!y", "^1")
  72. replace_all(msg, 190, "!t", "^3")
  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. replace_all(msg, 190, "Ü", "Ăś")
  90. replace_all(msg, 190, "Ű", "Ĺ°")
  91.  
  92. if (id) players[0] = id; else get_players(players, count, "ch")
  93. {
  94. for (new i = 0; i < count; i++)
  95. {
  96. if (is_user_connected(players[i]))
  97. {
  98. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
  99. write_byte(players[i])
  100. write_string(msg)
  101. message_end()
  102. }
  103. }
  104. }
  105. return PLUGIN_HANDLED
  106. }
  107.  
  108.  

Szerző:  LyleChriss [ 2015.05.12. 16:41 ]
Hozzászólás témája:  Re: Öléseid, halálaid bele írása (egyszerü kérés)

Ott van a HUD-ban az Öléseim és Halálaim, de nincs érték neki. Tehát ez kell neki. Gondolom rank-ból szeretné ezt az értéket lekérni, de én ehhez nem értek. :D

Szerző:  krisztian2 [ 2015.05.12. 17:33 ]
Hozzászólás témája:  Re: Öléseid, halálaid bele írása (egyszerü kérés)

hogy a hudba ezt mutassa
CT állás:
T állás:
Öléseim:
Halálaim:
radar alatt mutassa

Szerző:  ExE [ 2015.05.12. 17:39 ]
Hozzászólás témája:  Re: Öléseid, halálaid bele írása (egyszerü kérés)

SMA Forráskód: [ Mindet kijelol ]
  1.  
  2.  
  3. #include <amxmodx>
  4. #include <amxmisc>
  5. #include <cstrike>
  6. #include <dhudmessage>
  7.  
  8. #define PLUGIN "HUD Info"
  9. #define VERSION "1.0"
  10. #define AUTHOR "N/A"
  11.  
  12. #define MAXROUNDS 40
  13.  
  14. new Rounds
  15.  
  16. new iCTKills
  17. new iTTKills
  18.  
  19. public plugin_init() {
  20. register_plugin(PLUGIN, VERSION, AUTHOR)
  21. register_event( "DeathMsg", "DeathEvent", "a" );
  22. register_event("TextMsg","ResetAll","a","2&#Game_C","2&#Game_w")
  23. register_logevent("NewRounds", 2, "0=World triggered", "1=Round_Start")
  24. set_task(1.0,"HUDInfo" , _ , _ , _ , "b")
  25. }
  26.  
  27. public ResetAll() {
  28. Rounds = 0
  29. iCTKills = 0
  30. iTTKills = 0
  31. }
  32.  
  33. public DeathEvent(){
  34. new Killer = read_data( 1 );
  35. new CsTeams:Team
  36. Team = cs_get_user_team( Killer );
  37. if (Team == CS_TEAM_T)
  38. {
  39. iTTKills++
  40. }
  41. if (Team == CS_TEAM_CT)
  42. {
  43. iCTKills++
  44. }
  45. }
  46.  
  47. public NewRounds(){
  48. Rounds++
  49. }
  50.  
  51. public HUDInfo(){
  52. new Time[9]
  53. get_time("%H:%M",Time,8)
  54.  
  55. new CurrentPlayers = get_playersnum();
  56. new MaxPlayers = get_maxplayers();
  57.  
  58.  
  59. set_dhudmessage(random(255),random(255),random(255), 0.0, 0.19, 0, 6.0, 12.0)
  60. show_dhudmessage(0, "T állás: %d^nCT állás: %d^nÖléseid: [%d] Halálaid: [%d]", iTTKills, iCTKills)
  61.  
  62. }
  63.  
  64. stock print_color(const id, const input[], any:...)
  65. {
  66. new count = 1, players[32]
  67. static msg[191]
  68. vformat(msg, 190, input, 3)
  69.  
  70. replace_all(msg, 190, "!g", "^4")
  71. replace_all(msg, 190, "!y", "^1")
  72. replace_all(msg, 190, "!t", "^3")
  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. replace_all(msg, 190, "Ü", "Ăś")
  90. replace_all(msg, 190, "Ű", "Ĺ°")
  91.  
  92. if (id) players[0] = id; else get_players(players, count, "ch")
  93. {
  94. for (new i = 0; i < count; i++)
  95. {
  96. if (is_user_connected(players[i]))
  97. {
  98. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
  99. write_byte(players[i])
  100. write_string(msg)
  101. message_end()
  102. }
  103. }
  104. }
  105. return PLUGIN_HANDLED
  106. }
  107.  
  108.  

Szerző:  LyleChriss [ 2015.05.12. 18:09 ]
Hozzászólás témája:  Re: Öléseid, halálaid bele írása (egyszerü kérés)

Próbáld. Elvileg jó, lefordul.
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <cstrike>
  4.  
  5. #define PLUGIN "HUD Info"
  6. #define VERSION "1.0"
  7. #define AUTHOR "N/A"
  8.  
  9. #define MAXROUNDS 40
  10.  
  11. new Rounds
  12.  
  13. new iCTKills
  14. new iTTKills
  15. new iPKills[33]
  16. new iPDeaths[33]
  17. new SyncHudObj
  18.  
  19. public plugin_init() {
  20. register_plugin(PLUGIN, VERSION, AUTHOR)
  21. register_event( "DeathMsg", "DeathEvent", "a" );
  22. register_event("TextMsg","ResetAll","a","2&#Game_C","2&#Game_w")
  23. register_logevent("NewRounds", 2, "0=World triggered", "1=Round_Start")
  24. set_task(3.0,"HUDInfo" , _ , _ , _ , "b")
  25. SyncHudObj = CreateHudSyncObj()
  26. }
  27.  
  28. public ResetAll() {
  29. Rounds = 0
  30. iCTKills = 0
  31. iTTKills = 0
  32. }
  33.  
  34. public DeathEvent(){
  35. new attacker = read_data( 1 );
  36. new victim = read_data( 2 );
  37. new CsTeams:Team
  38. Team = cs_get_user_team( attacker );
  39. if (Team == CS_TEAM_T)
  40. {
  41. iTTKills++
  42. }
  43. if (Team == CS_TEAM_CT)
  44. {
  45. iCTKills++
  46. }
  47. iPKills[attacker] ++
  48.  
  49. iPDeaths[victim] ++
  50. }
  51.  
  52. public NewRounds(){
  53. Rounds++
  54. }
  55.  
  56. public HUDInfo(){
  57. new Time[9]
  58. get_time("%H:%M",Time,8)
  59.  
  60. new players[32], pnum, tempid
  61. get_players(players, pnum, "c")
  62. for(new i;i<pnum; i++)
  63. {
  64. tempid = players[i]
  65. set_hudmessage(255, 255, 255, 0.10, 0.2, 0, 6.0, 12.0)
  66. ShowSyncHudMsg(tempid, SyncHudObj, "T állás: %d^nCT állás: %d^nÖléseid: [%d] Halálaid: [%d]", iTTKills, iCTKills, iPKills[tempid], iPDeaths[tempid] )
  67. }
  68.  
  69. }
  70.  
  71. stock print_color(const id, const input[], any:...)
  72. {
  73. new count = 1, players[32]
  74. static msg[191]
  75. vformat(msg, 190, input, 3)
  76.  
  77. replace_all(msg, 190, "!g", "^4")
  78. replace_all(msg, 190, "!y", "^1")
  79. replace_all(msg, 190, "!t", "^3")
  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. replace_all(msg, 190, "Á", "Á")
  90. replace_all(msg, 190, "É", "É")
  91. replace_all(msg, 190, "Í", "ĂŤ")
  92. replace_all(msg, 190, "Ó", "Ă“")
  93. replace_all(msg, 190, "Ö", "Ă–")
  94. replace_all(msg, 190, "Ő", "Ő")
  95. replace_all(msg, 190, "Ú", "Ăš")
  96. replace_all(msg, 190, "Ü", "Ăś")
  97. replace_all(msg, 190, "Ű", "Ĺ°")
  98.  
  99. if (id) players[0] = id; else get_players(players, count, "ch")
  100. {
  101. for (new i = 0; i < count; i++)
  102. {
  103. if (is_user_connected(players[i]))
  104. {
  105. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
  106. write_byte(players[i])
  107. write_string(msg)
  108. message_end()
  109. }
  110. }
  111. }
  112. return PLUGIN_HANDLED
  113. }

Szerző:  V!rusHD [ 2015.05.12. 18:10 ]
Hozzászólás témája:  Re: Öléseid, halálaid bele írása (egyszerü kérés)

Szerintem így egyszerűbb:
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <cstrike>
  4. #include <dhudmessage>
  5.  
  6. #define PLUGIN "HUD Info"
  7. #define VERSION "1.0"
  8. #define AUTHOR "N/A"
  9.  
  10. #define MAXROUNDS 40
  11.  
  12. new Rounds
  13.  
  14. new iCTKills
  15. new iTTKills
  16.  
  17. new oles[33], halal[33]
  18.  
  19. public plugin_init() {
  20. register_plugin(PLUGIN, VERSION, AUTHOR)
  21. register_event( "DeathMsg", "DeathEvent", "a" );
  22. register_event("TextMsg","ResetAll","a","2&#Game_C","2&#Game_w")
  23. register_logevent("NewRounds", 2, "0=World triggered", "1=Round_Start")
  24. set_task(1.0,"HUDInfo" , _ , _ , _ , "b")
  25. }
  26.  
  27. public ResetAll() {
  28. Rounds = 0
  29. iCTKills = 0
  30. iTTKills = 0
  31. }
  32.  
  33. public DeathEvent(){
  34. new Killer = read_data(1)
  35. new Victim = read_data(2)
  36. new CsTeams:Team
  37. Team = cs_get_user_team( Killer );
  38. if (Team == CS_TEAM_T)
  39. {
  40. iTTKills++
  41. }
  42. if (Team == CS_TEAM_CT)
  43. {
  44. iCTKills++
  45. }
  46. if(Killer != Victim)
  47. {
  48. oles[Killer]++
  49. halal[Victim]++
  50. }
  51. }
  52.  
  53. public NewRounds(){
  54. Rounds++
  55. }
  56.  
  57. public HUDInfo(){
  58. new Time[9]
  59. get_time("%H:%M",Time,8)
  60.  
  61. new CurrentPlayers = get_playersnum();
  62. new MaxPlayers = get_maxplayers();
  63.  
  64.  
  65. set_dhudmessage(random(255),random(255),random(255), 0.0, 0.19, 0, 6.0, 12.0)
  66. show_dhudmessage(0, "T állás: %d^nCT állás: %d^nÖléseid: [%d] Halálaid: [%d]", iTTKills, iCTKills, oles[id], halal[id])
  67.  
  68. }
  69.  
  70. stock print_color(const id, const input[], any:...)
  71. {
  72. new count = 1, players[32]
  73. static msg[191]
  74. vformat(msg, 190, input, 3)
  75.  
  76. replace_all(msg, 190, "!g", "^4")
  77. replace_all(msg, 190, "!y", "^1")
  78. replace_all(msg, 190, "!t", "^3")
  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. replace_all(msg, 190, "É", "É")
  90. replace_all(msg, 190, "Í", "ĂŤ")
  91. replace_all(msg, 190, "Ó", "Ă“")
  92. replace_all(msg, 190, "Ö", "Ă–")
  93. replace_all(msg, 190, "Ő", "Ő")
  94. replace_all(msg, 190, "Ú", "Ăš")
  95. replace_all(msg, 190, "Ü", "Ăś")
  96. replace_all(msg, 190, "Ű", "Ĺ°")
  97.  
  98. if (id) players[0] = id; else get_players(players, count, "ch")
  99. {
  100. for (new i = 0; i < count; i++)
  101. {
  102. if (is_user_connected(players[i]))
  103. {
  104. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
  105. write_byte(players[i])
  106. write_string(msg)
  107. message_end()
  108. }
  109. }
  110. }
  111. return PLUGIN_HANDLED
  112. }
  113.  
  114.  

Szerző:  mforce [ 2015.05.12. 18:29 ]
Hozzászólás témája:  Re: Öléseid, halálaid bele írása (egyszerü kérés)

ÚRISTEN!
get_user_frags(id), cs_get_user_deaths(id)

Szerző:  LyleChriss [ 2015.05.12. 18:31 ]
Hozzászólás témája:  Re: Öléseid, halálaid bele írása (egyszerü kérés)

Jóvanna... Nem lehet mindenki okos... :oops:

Szerző:  V!rusHD [ 2015.05.12. 18:35 ]
Hozzászólás témája:  Re: Öléseid, halálaid bele írása (egyszerü kérés)

De ha azzal kéri le, nyom egy /rs-t és 0 lesz.

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