aha juz
[
Dodano: Czw 31 Sty, 2008 ]
#include <amxmodx>
#include <amxmisc>
new gFiles[300][128]
new gCount=0
public plugin_init()
{
register_plugin("RoundSound","2.0","PaintLancer")
register_event("SendAudio", "win", "a", "2&%!MRAD_terwin")
register_event("SendAudio", "win", "a", "2&%!MRAD_ctwin")
}
public win()
{
if(gCount>0)
{
new rand = random_num(0,gCount-1)
client_cmd(0,"stopsound")
set_hudmessage(255, 0, 0, 0.11, 0.11, 0, 6.0, 12.0)
show_hudmessage(0, "%s",gFiles[rand])
play_any_sound(gFiles[rand])
}
return PLUGIN_HANDLED
}
public plugin_precache()
{
new rsFile[128],s[128],i
get_configsdir(rsFile,12

add(rsFile,128,"/roundsound.ini")
i=fopen(rsFile,"rt")
gCount=0
if(i==0){
set_hudmessage(255, 0, 0, -1.0, 0.89, 0, 2.0, 20.0,0.1,0.1,-1)
show_hudmessage(0,"Error rs loading config file!")
} else {
while (!feof(i)) // Reading rs config from roundsound.ini
{
fgets(i,s,12

if (s[strlen(s)-1] == '^n')
{
s[strlen(s)-1] = 0
}
copy(gFiles[gCount],128,s)
gCount++
}
fclose(i)
}
for(i=0;i<gCount;i++)
{
format(s,128,"sound/misc/%s",gFiles[i])
precache_generic(s)
}
return PLUGIN_CONTINUE
}
public play_any_sound(sound[])
{
new is_mpeg = ( containi(sound, ".mp") != -1 )
if ( is_mpeg )
client_cmd(0, "mp3 play ^"sound/misc/%s^"", sound)
else
client_cmd(0, "spk ^"%s^"", sound)
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\ rtf1\ ansi\ deff0{\ fonttbl{\ f0\ fnil Tahoma;}}n\ viewkind4\ uc1\ pard\ lang1045\ f0\ fs16 n\ par }
*/
[
Dodano: Czw 31 Sty, 2008 ]
jestes? pomoze ktos bardzo prosze :sad: :sad: