hlmod.hu
https://hlmod.hu/

Kör végi visszaszámlálás
https://hlmod.hu/viewtopic.php?f=29&t=7620
Oldal: 1 / 1

Szerző:  norbee.16 [2013.03.07. 16:32 ]
Hozzászólás témája:  Kör végi visszaszámlálás

Hali!

Valaki meg írná nekem ezt a plugint, hogy amikor már a körből csak 10 másodperc van akkor vissza számoljon és hudba írja a képernyő közepén, hogy "%s Masodperc a Vegso Pusztulasig!" És nem kell bele az, hogy kör végén mindenki meg haljon.

Videó:
http://www.youtube.com/watch?feature=yo ... YzXPr61FJ8

Itt benne van aki nem tudná miről van szó! 3:47 től.
Előre is kösz :)

Szerző:  small [2013.03.07. 17:43 ]
Hozzászólás témája:  Re: Kör végi visszaszámlálás

SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2.  
  3. #include <amxmisc>
  4.  
  5. #include <zombieplague>
  6.  
  7.  
  8.  
  9. #define PLUGIN "[ZP] Szamok"
  10.  
  11. #define VERSION "1.0"
  12.  
  13. #define AUTHOR "Mr.Apple"
  14.  
  15.  
  16.  
  17. new const speak[ 10 ][] = {
  18.  
  19. "ebasound56/one.wav",
  20.  
  21. "ebasound56/two.wav",
  22.  
  23. "ebasound56/three.wav",
  24.  
  25. "ebasound56/four.wav",
  26.  
  27. "ebasound56/five.wav",
  28.  
  29. "ebasound56/six.wav",
  30.  
  31. "ebasound56/seven.wav",
  32.  
  33. "ebasound56/eight.wav",
  34.  
  35. "ebasound56/nine.wav",
  36.  
  37. "ebasound56/ten.wav"
  38.  
  39. }
  40.  
  41.  
  42. new szamol
  43. new countdown
  44.  
  45.  
  46.  
  47. public plugin_init() {
  48.  
  49. register_plugin(PLUGIN, VERSION, AUTHOR)
  50.  
  51. register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
  52. register_logevent("korkezdes",2,"1=Round_Start")
  53. }
  54.  
  55.  
  56.  
  57. public plugin_precache() {
  58.  
  59. precache_sound( "ebasound56/ten.wav" )
  60.  
  61. precache_sound( "ebasound56/nine.wav" )
  62.  
  63. precache_sound( "ebasound56/eight.wav" )
  64.  
  65. precache_sound( "ebasound56/seven.wav" )
  66.  
  67. precache_sound( "ebasound56/six.wav" )
  68.  
  69. precache_sound( "ebasound56/five.wav" )
  70.  
  71. precache_sound( "ebasound56/four.wav" )
  72.  
  73. precache_sound( "ebasound56/three.wav" )
  74.  
  75. precache_sound( "ebasound56/two.wav" )
  76.  
  77. precache_sound( "ebasound56/one.wav" )
  78.  
  79. }
  80.  
  81. public korkezdes()
  82. {
  83. new vegido = get_cvar_num("mp_roundtime")
  84.  
  85. set_task(float(vegido),"ido")
  86. szamol = 10
  87.  
  88. }
  89.  
  90. public ido()
  91. {
  92.  
  93. emit_sound( 0, CHAN_VOICE, speak[ szamol ], 1.0, ATTN_NORM, 0, PITCH_NORM )
  94.  
  95.  
  96.  
  97. set_hudmessage(179, 0, 0, -1.0, 0.28, 2, 0.02, 1.0, 0.01, 0.1, 10);
  98.  
  99. show_hudmessage(0, "%i Masodperc a Vegso Pusztulasig!", szamol);
  100.  
  101. szamol--
  102.  
  103.  
  104.  
  105. if(szamol > 0) {
  106.  
  107. set_task(1.0, "ido")
  108.  
  109. }
  110.  
  111. }
  112.  
  113.  
  114. public event_round_start() {
  115.  
  116. set_task(3.0, "zombie_countdown")
  117.  
  118. countdown = 9
  119.  
  120. }
  121.  
  122.  
  123.  
  124. public zombie_countdown() {
  125.  
  126. emit_sound( 0, CHAN_VOICE, speak[ countdown ], 1.0, ATTN_NORM, 0, PITCH_NORM )
  127.  
  128.  
  129.  
  130. set_hudmessage(179, 0, 0, -1.0, 0.28, 2, 0.02, 1.0, 0.01, 0.1, 10);
  131.  
  132. show_hudmessage(0, "Fertozesig hatravan: %i masodperc!", countdown);
  133.  
  134. countdown--
  135.  
  136.  
  137.  
  138. if(countdown > 0) {
  139.  
  140. set_task(1.0, "zombie_countdown")
  141.  
  142. }
  143.  
  144. }
  145.  

Szerző:  norbee.16 [2013.03.07. 18:09 ]
Hozzászólás témája:  Re: Kör végi visszaszámlálás

És a hangokat honan olvasa be?
u.i: Nem jobb lett volna ehez hasonlóan megoldani?
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2.  
  3. #include <amxmisc>
  4.  
  5. #include <zombieplague>
  6.  
  7.  
  8.  
  9. #define PLUGIN "[ZP] Szamok"
  10.  
  11. #define VERSION "1.0"
  12.  
  13. #define AUTHOR "Mr.Apple"
  14.  
  15.  
  16.  
  17. new const speak[ 10 ][] = {
  18.  
  19. "ebasound56/one.wav",
  20.  
  21. "ebasound56/two.wav",
  22.  
  23. "ebasound56/three.wav",
  24.  
  25. "ebasound56/four.wav",
  26.  
  27. "ebasound56/five.wav",
  28.  
  29. "ebasound56/six.wav",
  30.  
  31. "ebasound56/seven.wav",
  32.  
  33. "ebasound56/eight.wav",
  34.  
  35. "ebasound56/nine.wav",
  36.  
  37. "ebasound56/ten.wav"
  38.  
  39. }
  40.  
  41.  
  42.  
  43. new countdown
  44.  
  45.  
  46.  
  47. public plugin_init() {
  48.  
  49. register_plugin(PLUGIN, VERSION, AUTHOR)
  50.  
  51. register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
  52.  
  53. }
  54.  
  55.  
  56.  
  57. public plugin_precache() {
  58.  
  59. precache_sound( "ebasound56/ten.wav" )
  60.  
  61. precache_sound( "ebasound56/nine.wav" )
  62.  
  63. precache_sound( "ebasound56/eight.wav" )
  64.  
  65. precache_sound( "ebasound56/seven.wav" )
  66.  
  67. precache_sound( "ebasound56/six.wav" )
  68.  
  69. precache_sound( "ebasound56/five.wav" )
  70.  
  71. precache_sound( "ebasound56/four.wav" )
  72.  
  73. precache_sound( "ebasound56/three.wav" )
  74.  
  75. precache_sound( "ebasound56/two.wav" )
  76.  
  77. precache_sound( "ebasound56/one.wav" )
  78.  
  79. }
  80.  
  81.  
  82.  
  83. public event_round_start() {
  84.  
  85. set_task(3.0, "zombie_countdown")
  86.  
  87. countdown = 9
  88.  
  89. }
  90.  
  91.  
  92.  
  93. public zombie_countdown() {
  94.  
  95. emit_sound( 0, CHAN_VOICE, speak[ countdown ], 1.0, ATTN_NORM, 0, PITCH_NORM )
  96.  
  97.  
  98.  
  99. set_hudmessage(179, 0, 0, -1.0, 0.28, 2, 0.02, 1.0, 0.01, 0.1, 10);
  100.  
  101. show_hudmessage(0, "Fertozesig hatravan: %i masodperc!", countdown);
  102.  
  103. countdown--
  104.  
  105.  
  106.  
  107. if(countdown > 0) {
  108.  
  109. set_task(1.0, "zombie_countdown")
  110.  
  111. }
  112.  
  113. }

u.i.2:Csak kérdezem mert ez egyszerűbbnek tűnik :)

Szerző:  DeteCT0R [2013.03.07. 18:21 ]
Hozzászólás témája:  Re: Kör végi visszaszámlálás

Sajlent regebb megcsinalta nekem...Keresgelj :DUgyes gyerek vagy te.

Szerző:  small [2013.03.07. 18:30 ]
Hozzászólás témája:  Re: Kör végi visszaszámlálás

norbee.16 írta:
És a hangokat honan olvasa be?
u.i: Nem jobb lett volna ehez hasonlóan megoldani?
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2.  
  3. #include <amxmisc>
  4.  
  5. #include <zombieplague>
  6.  
  7.  
  8.  
  9. #define PLUGIN "[ZP] Szamok"
  10.  
  11. #define VERSION "1.0"
  12.  
  13. #define AUTHOR "Mr.Apple"
  14.  
  15.  
  16.  
  17. new const speak[ 10 ][] = {
  18.  
  19. "ebasound56/one.wav",
  20.  
  21. "ebasound56/two.wav",
  22.  
  23. "ebasound56/three.wav",
  24.  
  25. "ebasound56/four.wav",
  26.  
  27. "ebasound56/five.wav",
  28.  
  29. "ebasound56/six.wav",
  30.  
  31. "ebasound56/seven.wav",
  32.  
  33. "ebasound56/eight.wav",
  34.  
  35. "ebasound56/nine.wav",
  36.  
  37. "ebasound56/ten.wav"
  38.  
  39. }
  40.  
  41.  
  42.  
  43. new countdown
  44.  
  45.  
  46.  
  47. public plugin_init() {
  48.  
  49. register_plugin(PLUGIN, VERSION, AUTHOR)
  50.  
  51. register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
  52.  
  53. }
  54.  
  55.  
  56.  
  57. public plugin_precache() {
  58.  
  59. precache_sound( "ebasound56/ten.wav" )
  60.  
  61. precache_sound( "ebasound56/nine.wav" )
  62.  
  63. precache_sound( "ebasound56/eight.wav" )
  64.  
  65. precache_sound( "ebasound56/seven.wav" )
  66.  
  67. precache_sound( "ebasound56/six.wav" )
  68.  
  69. precache_sound( "ebasound56/five.wav" )
  70.  
  71. precache_sound( "ebasound56/four.wav" )
  72.  
  73. precache_sound( "ebasound56/three.wav" )
  74.  
  75. precache_sound( "ebasound56/two.wav" )
  76.  
  77. precache_sound( "ebasound56/one.wav" )
  78.  
  79. }
  80.  
  81.  
  82.  
  83. public event_round_start() {
  84.  
  85. set_task(3.0, "zombie_countdown")
  86.  
  87. countdown = 9
  88.  
  89. }
  90.  
  91.  
  92.  
  93. public zombie_countdown() {
  94.  
  95. emit_sound( 0, CHAN_VOICE, speak[ countdown ], 1.0, ATTN_NORM, 0, PITCH_NORM )
  96.  
  97.  
  98.  
  99. set_hudmessage(179, 0, 0, -1.0, 0.28, 2, 0.02, 1.0, 0.01, 0.1, 10);
  100.  
  101. show_hudmessage(0, "Fertozesig hatravan: %i masodperc!", countdown);
  102.  
  103. countdown--
  104.  
  105.  
  106.  
  107. if(countdown > 0) {
  108.  
  109. set_task(1.0, "zombie_countdown")
  110.  
  111. }
  112.  
  113. }

u.i.2:Csak kérdezem mert ez egyszerűbbnek tűnik :)

Szerkesztettem az előzőt

Szerző:  crazy` [2013.03.07. 18:34 ]
Hozzászólás témája:  Re: Kör végi visszaszámlálás

szerintem nem kell ennyire bonyolítani, ittvan egyszerűbben akár:
SMA Forráskód: [ Mindet kijelol ]
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include <amxmisc>
  4.  
  5. #define PLUGIN "Visszaszamlalo"
  6. #define VERSION "1.0"
  7. #define AUTHOR "crazy"
  8.  
  9. new szamlal;
  10.  
  11. new const visszaszamlal[][] = {
  12.  
  13. "10.wav",
  14.  
  15. "9.wav",
  16.  
  17. "8.wav",
  18.  
  19. "7.wav",
  20.  
  21. "6.wav",
  22.  
  23. "5.wav",
  24.  
  25. "4.wav",
  26.  
  27. "3.wav",
  28.  
  29. "2.wav",
  30.  
  31. "1.wav"
  32. }
  33.  
  34. public plugin_init() {
  35.  
  36. register_plugin(PLUGIN, VERSION, AUTHOR);
  37. register_logevent("RoundStart", 2, "1=Round_Start");
  38. }
  39. public plugin_precache()
  40. {
  41. for(new i=0; i<sizeof(visszaszamlal); i++)
  42.  
  43. {
  44. new linetext[10];
  45.  
  46. formatex(linetext, 9, "%s", visszaszamlal[i]);
  47. precache_sound(linetext);
  48. }
  49. }
  50.  
  51. public RoundStart()
  52. {
  53. szamlal = 10;
  54.  
  55. new min = get_cvar_num("mp_roundtime");
  56. new sec = min * 60;
  57. new counti = sec-10;
  58.  
  59. set_task(counti, "szamlalas");
  60. }
  61. public szamlalas()
  62. {
  63. if(szamlal)
  64. {
  65. set_hudmessage(255, 255, 255, 0.17, 0.42, 0, 6.0, 1.0)
  66. show_hudmessage(0, "%d masodperc a vegso pusztulasig!", szamlal)
  67.  
  68. new players[32], pnum;
  69.  
  70. get_players(players, pnum);
  71.  
  72. for(new i=0; i<pnum; i++)
  73.  
  74. {
  75.  
  76. new id = players[i];
  77.  
  78. client_cmd(id, "speak %d", visszaszamlal[szamlal]);
  79. }
  80. szamlal--;
  81.  
  82. set_task(1.0, "countdown");
  83. }
  84. }
  85.  

Szerző:  norbee.16 [2013.03.07. 19:01 ]
Hozzászólás témája:  Re: Kör végi visszaszámlálás

DeteCT0R írta:
Sajlent regebb megcsinalta nekem...Keresgelj :DUgyes gyerek vagy te.

Olvasd el az utolsó hszm xd
www.hlmod.hu/viewtopic.php?f=29&t=5302&hilit=+k%C3%B6r
u.i: ezért nyitotam új témát.
u.i.2: Crazy a 10.wav él írjam pl: Azt, hogy 'ebasound56/10.wav'? vagy hagyam úgy?

Szerző:  norbee.16 [2013.03.30. 01:23 ]
Hozzászólás témája:  Re: Kör végi visszaszámlálás

crazy erre a kérdésemre nem válaszoltál:
u.i.2: Crazy a 10.wav elé írjam pl: Azt, hogy 'ebasound56/10.wav'? vagy hagyam úgy? És ha nem kell át írni akkor a sound mappából olvasa a hangokat?? :)

Szerző:  crazy` [2013.03.30. 07:48 ]
Hozzászólás témája:  Re: Kör végi visszaszámlálás

norbee.16 írta:
crazy erre a kérdésemre nem válaszoltál:
u.i.2: Crazy a 10.wav elé írjam pl: Azt, hogy 'ebasound56/10.wav'? vagy hagyam úgy? És ha nem kell át írni akkor a sound mappából olvasa a hangokat?? :)

a sound mappából olvassa, ha mappában van, írd elé hogy melyikben.

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