Sciągnąłem pliki .sma .amxx .ini, dopisałem do ini nazwy mp3, all zrobilem tak jak trzeba.
Na początku wgrałem 2 mp3, i tylko jedna ostatnia się odtwarzała, i tylko ona się sciągnęła.
Wchodze na serwer, sciąga się ostatnia .mp3, a reszta nic, (ostatnia mp3 w roundsound.ini), a rsezta nic.
Nie sciągają się, ani nie odtwarzają, proszę o pomoc.
Zawartosc roundsound.ini:
florida.mp3
let_bodies.mp3
guralesko.mp3
feel.mp3
heart.mp3
lasgo.mp3
Zawartosc roundsound.sma
#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,128)
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,128)
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 }
*/


Dodatki SourceMod



Temat jest zamknięty









