|
New Member
|
03-30-2008
, 08:01
Re: End Round Sounds
|
#112
|
Can anyone tell me what`s wrong? Thx! It download mp3s and there are no errors in console but there is just silence after round.
//RoundSound.amxx -by PaintLancer
// mp3-Support added by Isobold
// How to use this plugin:
// Configure the plugin by adding/replacing the Filenames and functioncalls in pluginprecache() as described below.
// Pay attention to use the specific method for wav and mp3-Files.
// Place the sma-file into your amxmodx/scripting-Folder and compile it.
// Copy the result amxmodx/scripting/compiled/roundsound.amxx into amxmodx/plugins.
// Add plugin name to /amxmodx/config/plugin.ini
// Upload all sounds into the folders you have specified
// Change map and enjoy the sounds at round end
// Following dirs and files are assumed for examples below:
// cstrike
// |
// \-- mp3
// | |
// | \-- mympegfile.mp3
// |
// \-- sound
// |
// \-- misc
// |
// \-- mywavfile.wav
// Precache and play a mp3-File:
// Precache:
// precache_generic("mp3-Path")
// Example:
// precache_generic("mp3/mympegfile.mp3")
// Play example:
// play_any_sound("mp3/mympegfile.mp3")
// Precache and play a wav-File:
// Precache:
// precache_sound("wav-Path")
// Example:
// precache_sound("misc/mywavfile.wav")
// Play example:
// play_any_sound("misc/mywavfile")
// !!!!!! Attention, dont append the .wav-Ending here !!!!!!
// Make sure to have an equal number of sounds for T and CT.
// Make sure to adjust MAX_RAND before compile, if you changed the number of sounds.
#include <amxmodx>
#define MAX_RAND 5
public plugin_init()
{
register_plugin("RoundSound","1.1","PaintLanc er&Isobold")
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(0,MAX_RAND)
client_cmd(0,"stopsound")
switch(rand)
{
case 0: play_any_sound("misc/tterro1")
case 1: play_any_sound("misc/tterro2")
case 2: play_any_sound("misc/tterro3")
case 3: play_any_sound("misc/tterro4")
case 4: play_any_sound("misc/tterro5")
case 5: play_any_sound("misc/tterro6")
}
return PLUGIN_HANDLED
}
public ct_win()
{
new rand = random_num(0,5)
client_cmd(0,"stopsound")
switch(rand)
{
case 0: play_any_sound("misc/cete1.mp3")
case 1: play_any_sound("misc/cete2.mp3")
case 2: play_any_sound("misc/cete3.mp3")
case 3: play_any_sound("misc/cete4.mp3")
case 4: play_any_sound("misc/cete5.mp3")
case 5: play_any_sound("misc/cete6.mp3")
}
return PLUGIN_HANDLED
}
public play_any_sound(sound[])
{
new is_mpeg = ( containi(sound, ".mp") != -1 )
if ( is_mpeg )
client_cmd(0, "mp3 play ^"%s^"", sound)
else
client_cmd(0, "spk ^"%s^"", sound)
}
public plugin_precache()
{
precache_sound("misc/cete1.mp3")
precache_sound("misc/cete2.mp3")
precache_sound("misc/cete3.mp3")
precache_sound("misc/cete4.mp3")
precache_sound("misc/cete5.mp3")
precache_sound("misc/cete6.mp3")
precache_sound("misc/tterro1.mp3")
precache_sound("misc/tterro2.mp3")
precache_sound("misc/tterro3.mp3")
precache_sound("misc/tterro4.mp3")
precache_sound("misc/tterro5.mp3")
precache_sound("misc/tterro6.mp3")
return PLUGIN_CONTINUE
}
|
|
|
|