Raised This Month: $344 Target: $400
 86%   Almost there!

[Help] Round Sound


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mikaeel123
Senior Member
Join Date: Oct 2018
Old 05-02-2020 , 12:14   [Help] Round Sound
Reply With Quote #1

Hello . i create a plugin round sound . but it doesnt work
PHP Code:
#include <amxmodx>

public plugin_init() 

  
register_plugin("RoundSound","1.0","PaintLancer")
  
register_event("SendAudio""t_win""a""2&%!MRAD_terwin")
  
register_event("SendAudio""ct_win""a""2&%!MRAD_ctwin")  
}

public 
t_win()
{
  new 
rand random_num(1,2)

  
client_cmd(0,"stopsound")

  switch(
rand)
  {
    case 
1client_cmd(0"spk %s""NG_Jail/RS/NG_1.mp3");
    case 
2client_cmd(0"spk %s""NG_Jail/RS/NG_1.mp3");
  }

  return 
PLUGIN_HANDLED
}

public 
ct_win()
{
  new 
rand random_num(1,2)

  
client_cmd(0,"stopsound")

  switch(
rand)
  {
    case 
1client_cmd(0"spk %s""NG_Jail/RS/NG_1.mp3");
    case 
2client_cmd(0"spk %s""NG_Jail/RS/NG_1.mp3");
  }

  return 
PLUGIN_HANDLED
}

public 
plugin_precache() 
{
  
precache_sound("NG_Jail/RS/NG_1.mp3")
  
precache_sound("NG_Jail/RS/NG_2.mp3")

  return 
PLUGIN_CONTINUE

And Here is the sounds
https://www.mediafire.com/file/8fayh..._Jail.zip/file
please tell me wants wrong ?
what my problem ?
Mikaeel123 is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 05-02-2020 , 12:15   Re: [Help] Round Sound
Reply With Quote #2

PHP Code:
"spk %s""NG_Jail/RS/NG_1.mp3" 
->
PHP Code:
"mp3 play NG_Jail/RS/NG_1.mp3" 
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
Mikaeel123
Senior Member
Join Date: Oct 2018
Old 05-02-2020 , 12:24   Re: [Help] Round Sound
Reply With Quote #3

Not playing again
PHP Code:
#include <amxmodx>

public plugin_init() 

  
register_plugin("RoundSound","1.0","PaintLancer")
  
register_event("SendAudio""t_win""a""2&%!MRAD_terwin")
  
register_event("SendAudio""ct_win""a""2&%!MRAD_ctwin")  
}

public 
t_win()
{
  new 
rand random_num(1,2)

  
client_cmd(0,"stopsound")

  switch(
rand)
  {
    case 
1client_cmd(0"mp3 play NG_Jail/RS/NG_1.mp3");
    case 
2client_cmd(0"mp3 play NG_Jail/RS/NG_2.mp3");
  }

  return 
PLUGIN_HANDLED
}

public 
ct_win()
{
  new 
rand random_num(1,2)

  
client_cmd(0,"stopsound")

  switch(
rand)
  {
    case 
1client_cmd(0"mp3 play NG_Jail/RS/NG_1.mp3");
    case 
2client_cmd(0"mp3 play NG_Jail/RS/NG_2.mp3");
  }

  return 
PLUGIN_HANDLED
}

public 
plugin_precache() 
{
  
precache_sound("NG_Jail/RS/NG_1.mp3")
  
precache_sound("NG_Jail/RS/NG_2.mp3")

  return 
PLUGIN_CONTINUE

Mikaeel123 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-02-2020 , 13:27   Re: [Help] Round Sound
Reply With Quote #4

mp3 play sound/...

Just use this - https://forums.alliedmods.net/showthread.php?p=499872
No need to recreate something that already exists. Your code is 100 times worse.
__________________

Last edited by OciXCrom; 05-02-2020 at 13:28.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 05-02-2020 , 13:29   Re: [Help] Round Sound
Reply With Quote #5

Then your files are invalid or the events are registered incorrectly and do not trigger. Try converting them for the first case.
Also the stopsound command is not needed and change precache_sound to precache_generic. Always use generic when the files are not used server-sided.
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
Mikaeel123
Senior Member
Join Date: Oct 2018
Old 05-02-2020 , 14:08   Re: [Help] Round Sound
Reply With Quote #6

i use this . i run this plugin on my server . in the file roundsound i add jail_4ever.ini and add to it new sounds .
doesnt work
Mikaeel123 is offline
Vieni
Member
Join Date: Apr 2018
Old 05-02-2020 , 14:57   Re: [Help] Round Sound
Reply With Quote #7

Quote:
Originally Posted by Mikaeel123 View Post
i use this . i run this plugin on my server . in the file roundsound i add jail_4ever.ini and add to it new sounds .
doesnt work
Try precache generic:
Code:
precache_generic("sound/..")
and try the client_cmd like this:
Code:
client_cmd(0, "mp3 play ^"sound/..^"")

Last edited by Vieni; 05-02-2020 at 14:58.
Vieni is offline
Mikaeel123
Senior Member
Join Date: Oct 2018
Old 05-09-2020 , 03:49   Re: [Help] Round Sound
Reply With Quote #8

Hello . i listen the music when im go spec for afk
its not play end rounds
how can i play for end rounds ?
Mikaeel123 is offline
Old 05-09-2020, 04:03
Mikaeel123
This message has been deleted by Mikaeel123.
Mikaeel123
Senior Member
Join Date: Oct 2018
Old 05-09-2020 , 04:47   Re: [Help] Round Sound
Reply With Quote #9

i was copy this round sound from this plugin
PHP Code:
#include <amxmodx>

public plugin_init() 

  
register_plugin("RoundSound","1.0","PaintLancer")
  
register_event("SendAudio""t_win""a""2&%!MRAD_terwin")
  
register_event("SendAudio""ct_win""a""2&%!MRAD_ctwin")  
}

public 
t_win()
{
  new 
rand random_num(1,16)

  
client_cmd(0,"stopsound")

  switch(
rand)
  {
    case 
1client_cmd(0,"spk misc/t-bbs1-t")
    case 
2client_cmd(0,"spk misc/t-bbs2-t")
    case 
3client_cmd(0,"spk misc/t-bbs3-t")
    case 
4client_cmd(0,"spk misc/t-bbs4-t")
    case 
5client_cmd(0,"spk misc/t-bbs5-t")
    case 
6client_cmd(0,"spk misc/t-bbs6-t")
    case 
7client_cmd(0,"spk misc/t-bbs7-t")
    case 
8client_cmd(0,"spk misc/t-bbs8-t")
    case 
9client_cmd(0,"spk misc/t-bbs9-t")
    case 
10client_cmd(0,"spk misc/t-bbs10-t")
    case 
11client_cmd(0,"spk misc/t-bbs11-t")
    case 
12client_cmd(0,"spk misc/t-bbs12-t")
    case 
13client_cmd(0,"spk misc/t-bbs13-t")
    case 
14client_cmd(0,"spk misc/t-bbs14-t")
    case 
15client_cmd(0,"spk misc/t-bbs15-t")
    case 
16client_cmd(0,"spk misc/t-bbs16-t")
  }

  return 
PLUGIN_HANDLED
}

public 
ct_win()
{
  new 
rand random_num(1,16)

  
client_cmd(0,"stopsound")

  switch(
rand)
  {
    case 
1client_cmd(0,"spk misc/ct-bbs1-ct")
    case 
2client_cmd(0,"spk misc/ct-bbs2-ct")
    case 
3client_cmd(0,"spk misc/ct-bbs3-ct")
    case 
4client_cmd(0,"spk misc/ct-bbs4-ct")
    case 
5client_cmd(0,"spk misc/ct-bbs5-ct")
    case 
6client_cmd(0,"spk misc/ct-bbs6-ct")
    case 
7client_cmd(0,"spk misc/ct-bbs7-ct")
    case 
8client_cmd(0,"spk misc/ct-bbs8-ct")
    case 
9client_cmd(0,"spk misc/ct-bbs9-ct")
    case 
10client_cmd(0,"spk misc/ct-bbs10-ct")
    case 
11client_cmd(0,"spk misc/ct-bbs11-ct")
    case 
12client_cmd(0,"spk misc/ct-bbs12-ct")
    case 
13client_cmd(0,"spk misc/ct-bbs13-ct")
    case 
14client_cmd(0,"spk misc/ct-bbs14-ct")
    case 
15client_cmd(0,"spk misc/ct-bbs15-ct")
    case 
16client_cmd(0,"spk misc/ct-bbs16-ct")
  }

  return 
PLUGIN_HANDLED
}

public 
plugin_precache() 
{
  
precache_sound("misc/ct-bbs1-ct.wav")
  
precache_sound("misc/ct-bbs2-ct.wav")
  
precache_sound("misc/ct-bbs3-ct.wav")
  
precache_sound("misc/ct-bbs4-ct.wav")
  
precache_sound("misc/ct-bbs5-ct.wav")
  
precache_sound("misc/ct-bbs6-ct.wav")
  
precache_sound("misc/ct-bbs7-ct.wav")
  
precache_sound("misc/ct-bbs8-ct.wav")
  
precache_sound("misc/ct-bbs9-ct.wav")
  
precache_sound("misc/ct-bbs10-ct.wav")
  
precache_sound("misc/ct-bbs11-ct.wav")
  
precache_sound("misc/ct-bbs12-ct.wav")
  
precache_sound("misc/ct-bbs13-ct.wav")
  
precache_sound("misc/ct-bbs14-ct.wav")
  
precache_sound("misc/ct-bbs15-ct.wav")
  
precache_sound("misc/ct-bbs16-ct.wav")
  
precache_sound("misc/t-bbs1-t.wav")
  
precache_sound("misc/t-bbs2-t.wav")
  
precache_sound("misc/t-bbs3-t.wav")
  
precache_sound("misc/t-bbs4-t.wav")
  
precache_sound("misc/t-bbs5-t.wav")
  
precache_sound("misc/t-bbs6-t.wav")
  
precache_sound("misc/t-bbs7-t.wav")
  
precache_sound("misc/t-bbs8-t.wav")
  
precache_sound("misc/t-bbs9-t.wav")
  
precache_sound("misc/t-bbs10-t.wav")
  
precache_sound("misc/t-bbs11-t.wav")
  
precache_sound("misc/t-bbs12-t.wav")
  
precache_sound("misc/t-bbs13-t.wav")
  
precache_sound("misc/t-bbs14-t.wav")
  
precache_sound("misc/t-bbs15-t.wav")
  
precache_sound("misc/t-bbs16-t.wav")

  return 
PLUGIN_CONTINUE

now i want only 2 sound Repetition in rounds
This my source how play it 2 sound all rounds ?
PHP Code:
#include <amxmodx>

public plugin_init() 

  
register_plugin("RoundSound","1.0","PaintLancer")
  
register_event("SendAudio""t_win""a""2&%!MRAD_terwin")
  
register_event("SendAudio""ct_win""a""2&%!MRAD_ctwin")  
}

public 
t_win()
{
  new 
rand random_num(1,2)

  
client_cmd(0,"stopsound")

  switch(
rand)
  {
    case 
1client_cmd(0"mp3 play ^"sound/NG_Jail/RS/NG_1^"")
    case 
2client_cmd(0"mp3 play ^"sound/NG_Jail/RS/NG_2^"")
  }

  return 
PLUGIN_HANDLED
}

public 
ct_win()
{
  new 
rand random_num(1,2)

  
client_cmd(0,"stopsound")

  switch(
rand)
  {
    case 
1client_cmd(0"mp3 play ^"sound/NG_Jail/RS/NG_1^"")
    case 
2client_cmd(0"mp3 play ^"sound/NG_Jail/RS/NG_2^"")
  }

  return 
PLUGIN_HANDLED
}

public 
plugin_precache() 
{
  
precache_generic("sound/NG_Jail/RS/NG_1.mp3")
  
precache_generic("sound/NG_Jail/RS/NG_2.mp3")

  return 
PLUGIN_CONTINUE

Mikaeel123 is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 05-09-2020 , 11:33   Re: [Help] Round Sound
Reply With Quote #10

File extensions were missing. Too many quotes and escape characters.
Code:
    case 1: client_cmd(0, "mp3 play ^"sound/NG_Jail/RS/NG_1^"")
    case 2: client_cmd(0, "mp3 play ^"sound/NG_Jail/RS/NG_2^"")
Code:
case 1: client_cmd(0, "mp3 play sound/NG_Jail/RS/NG_1.mp3") case 2: client_cmd(0, "mp3 play sound/NG_Jail/RS/NG_2.mp3")
__________________

Last edited by DJEarthQuake; 05-09-2020 at 12:00.
DJEarthQuake is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:16.


Powered by vBulletin®
Copyright ©2000 - 2022, vBulletin Solutions, Inc.
Theme made by Freecode