hlmod.hu
https://hlmod.hu/

Hud
https://hlmod.hu/viewtopic.php?f=9&t=19317
Oldal: 2 / 2

Szerző:  excitedboy [ 2015.02.04. 16:23 ]
Hozzászólás témája:  Re: Hud

Bocsánat, én néztem el valamit, azért bugolt. Ez már jó lesz:

SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <engine>
  4. #include <cstrike>
  5. #include <csstats>
  6.  
  7. #define PLUGIN "Slot,Frag,FPS"
  8. #define VERSION "1.0"
  9. #define AUTHOR "CrB"
  10.  
  11. new ctfrag
  12. new tfrag
  13. new g_fps[33][11];
  14. new g_i[33];
  15.  
  16. public plugin_init() {
  17. register_plugin(PLUGIN, VERSION, AUTHOR)
  18. register_event("DeathMsg", "halal", "a")
  19. register_logevent("round_first", 2, "0=World triggered", "1&Restart_Round_")
  20. register_logevent("round_first", 2, "0=World triggered", "1=Game_Commencing")
  21. }
  22.  
  23.  
  24. public client_putinserver(id) set_task(0.1, "count", id, "", 0, "b");
  25.  
  26. public client_disconnect(id) remove_task(id);
  27.  
  28. public client_PreThink(id) {
  29. g_fps[id][10]++;
  30.  
  31. new stats[8],bodyhits[8],irank
  32. irank = get_user_stats(id,stats,bodyhits)
  33. new mrank = get_statsnum()
  34.  
  35. set_hudmessage(random_num(0,255), random_num(0,255), random_num(0,255), 0.0, 0.26, 0, 6.0, 1.0)
  36. show_hudmessage(id, "Slot %d/%d^n Ct frag: %d^nT frag: %d^nFPS: %i ^nRankod: %d/%d", get_playersnum(), get_maxplayers(), ctfrag, tfrag, get_user_fps(id), irank, mrank)
  37.  
  38. }
  39.  
  40.  
  41. public halal()
  42. {
  43. if(read_data(1) != read_data(2) && cs_get_user_team(read_data(1)) == CS_TEAM_CT)
  44. {
  45. ctfrag++
  46. }
  47. else if(read_data(1) != read_data(2) && cs_get_user_team(read_data(1)) == CS_TEAM_T)
  48. {
  49. tfrag++
  50. }
  51. }
  52. public round_first()
  53. {
  54. ctfrag = 0
  55. tfrag = 0
  56. }
  57. public count(id) {
  58.  
  59. if ( g_i[id] < 9 )
  60. g_i[id]++;
  61. else
  62. g_i[id] = 0;
  63.  
  64. g_fps[id][g_i[id]] = g_fps[id][10];
  65. g_fps[id][10] = 0;
  66. }
  67.  
  68. stock get_user_fps(id)
  69. {
  70. new i;
  71. new j = 0;
  72.  
  73. for ( i = 0 ; i < 9 ; i++ )
  74. j += g_fps[id][i];
  75.  
  76. return j - 5;
  77. }

Szerző:  apple [ 2015.02.04. 19:29 ]
Hozzászólás témája:  Re: Hud

Szia látom nagyon rendes akar lenni és korrekt de mindig buggol :)
létszíves ebbe írd bele a rank ot meg a slot ot mert ebbe 100% hogy nem buggol mert teszteltem a hud ot! :)

SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2.  
  3. #define PLUGIN "infomacio"
  4.  
  5. #define VERSION "1.0"
  6.  
  7. #define AUTHOR "asd"
  8.  
  9.  
  10.  
  11. new ctfrags = 0
  12.  
  13. new tfrags = 0
  14.  
  15.  
  16.  
  17. public plugin_init() {
  18.  
  19. register_plugin(PLUGIN, VERSION, AUTHOR)
  20.  
  21. register_event("DeathMsg", "halal", "a");
  22.  
  23. register_logevent("round_first", 2, "0=World triggered", "1&Restart_Round_")
  24.  
  25. register_logevent("round_first", 2, "0=World triggered", "1=Game_Commencing")
  26.  
  27. set_task(5.0, "hud")
  28.  
  29. }
  30.  
  31.  
  32.  
  33. public round_first()
  34.  
  35. ctfrags = 0, tfrags = 0
  36.  
  37.  
  38.  
  39. public halal()
  40.  
  41. {
  42.  
  43. static killer
  44.  
  45. killer = read_data(1);
  46.  
  47. if(get_user_team(killer) == 2)
  48.  
  49. ctfrags++
  50.  
  51. if(get_user_team(killer) == 1)
  52.  
  53. tfrags++
  54.  
  55. return PLUGIN_CONTINUE
  56.  
  57. }
  58.  
  59.  
  60.  
  61. public hud() {
  62.  
  63. set_hudmessage(0, 102, 204, 0.01, 0.15, 0, 0.6, 5.0)
  64.  
  65. show_hudmessage(0,"Rank: ^n Slot:",ctfrags, tfrags)
  66.  
  67. set_task(5.0, "hud")
  68.  
  69. }

Szerző:  excitedboy [ 2015.02.04. 19:41 ]
Hozzászólás témája:  Re: Hud

Remélem most már megleszel elégedve. :) Elég sokat segítettem. :)

SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <engine>
  4. #include <cstrike>
  5. #include <csstats>
  6.  
  7.  
  8. #define PLUGIN "infomacio"
  9. #define VERSION "1.0"
  10. #define AUTHOR "asd"
  11.  
  12. new ctfrags = 0
  13. new tfrags = 0
  14. new stats[8]
  15. new bodyhits[8]
  16. new irank
  17.  
  18.  
  19.  
  20. public plugin_init() {
  21.  
  22. register_plugin(PLUGIN, VERSION, AUTHOR)
  23. register_event("DeathMsg", "halal", "a");
  24. register_logevent("round_first", 2, "0=World triggered", "1&Restart_Round_")
  25. register_logevent("round_first", 2, "0=World triggered", "1=Game_Commencing")
  26.  
  27. set_task(5.0, "hud")
  28.  
  29. }
  30.  
  31.  
  32.  
  33. public round_first()
  34.  
  35. ctfrags = 0, tfrags = 0
  36.  
  37.  
  38.  
  39. public halal()
  40.  
  41. {
  42.  
  43. static killer
  44.  
  45. killer = read_data(1);
  46.  
  47. if(get_user_team(killer) == 2)
  48.  
  49. ctfrags++
  50.  
  51. if(get_user_team(killer) == 1)
  52.  
  53. tfrags++
  54.  
  55. return PLUGIN_CONTINUE
  56.  
  57. }
  58.  
  59.  
  60.  
  61. public hud(id) {
  62. irank = get_user_stats(id,stats,bodyhits)
  63. new mrank = get_statsnum()
  64.  
  65. set_hudmessage(0, 102, 204, 0.01, 0.15, 0, 0.6, 5.0)
  66. show_hudmessage(id, "Slot %d/%d^n CT frag: %d^nT frag: %d ^nRankod: %d/%d", get_playersnum(), get_maxplayers(), ctfrags, tfrags, irank, mrank)
  67. set_task(5.0, "hud")
  68.  
  69. }

Szerző:  apple [ 2015.02.04. 19:57 ]
Hozzászólás témája:  Re: Hud

Bocsi még annyi hogy ez már jó nem buggol de egy olyan baj van vele hogy írja hogy hányan voltak fent "rank" csak a helyezésnél enyém helyett pl 75/208 ezt írja 0/208


valami baj van azzal hogy az én rankomat mutassa mert az jó hogy hányan voltak fent csak az nem hogy abból hanyadig vagyok ezt még tudnád javítani?

Szerző:  excitedboy [ 2015.02.04. 22:48 ]
Hozzászólás témája:  Re: Hud

Try:

SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <engine>
  4. #include <cstrike>
  5. #include <csstats>
  6.  
  7.  
  8. #define PLUGIN "infomacio"
  9. #define VERSION "1.0"
  10. #define AUTHOR "asd"
  11.  
  12. new ctfrags = 0
  13. new tfrags = 0
  14.  
  15. public plugin_init() {
  16.  
  17. register_plugin(PLUGIN, VERSION, AUTHOR)
  18. register_event("DeathMsg", "halal", "a");
  19. register_logevent("round_first", 2, "0=World triggered", "1&Restart_Round_")
  20. register_logevent("round_first", 2, "0=World triggered", "1=Game_Commencing")
  21.  
  22. set_task(5.0, "hud")
  23.  
  24. }
  25. public round_first()
  26.  
  27. ctfrags = 0, tfrags = 0
  28.  
  29. public halal()
  30.  
  31. {
  32.  
  33. static killer
  34.  
  35. killer = read_data(1);
  36.  
  37. if(get_user_team(killer) == 2)
  38.  
  39. ctfrags++
  40.  
  41. if(get_user_team(killer) == 1)
  42.  
  43. tfrags++
  44.  
  45. return PLUGIN_CONTINUE
  46.  
  47. }
  48. public hud(id) {
  49. new stats[8],bodyhits[8],irank
  50. irank = get_user_stats(id,stats,bodyhits)
  51. new mrank = get_statsnum()
  52.  
  53. set_hudmessage(0, 102, 204, 0.01, 0.15, 0, 0.6, 5.0)
  54. show_hudmessage(id, "Slot %d/%d^n CT frag: %d^nT frag: %d ^nRankod: %d/%d", get_playersnum(), get_maxplayers(), ctfrags, tfrags, irank, mrank)
  55. set_task(5.0, "hud")
  56. }

Szerző:  BeepBeep [ 2015.02.07. 22:26 ]
Hozzászólás témája:  Re: Hud

Használd az SMA kódot...
Átláthatóbb lesz egy "pöppet".

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