Mam problem z tym pluginem gdyz wogóle mi ni działa .
Proszę o pomoc. Plik roundsound.ini napisalem tak:
cSoundsDir[] = "sound/misc/"
001.mp3
002.mp3
Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
|
Napisano 24.03.2010 00:25
cSoundsDir[] = "sound/misc/"
001.mp3
002.mp3
Napisano 24.03.2010 05:56
new cSoundsDir[] = "sound/ledsplej/"
new cSoundsDir[] = "sound/muza/"No i oczywiście ponownie skompilować plugin.
Napisano 24.03.2010 13:05
// ==========
// Kobra
// www.ledsplej.net
// Use it but give me credits!
// ==========
#include <amxmodx>
#include <amxmisc>
new gFiles[300][128]
new gCount=0
new cSoundsDir[] = "sound/misc/"
public plugin_init()
{
register_plugin("RoundSound","2.1","Kobra LeD")
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")
new cleanFile[128]
format(cleanFile, 128, "%s", gFiles[rand])
replace_all(cleanFile, 128, "_", " ")
replace_all(cleanFile, 128, ".mp3", "")
set_hudmessage(255, 0, 0, 0.11, 0.11, 0, 6.0, 12.0)
show_hudmessage(0, "%s",cleanFile)
play_any_sound(gFiles[rand])
}
return PLUGIN_HANDLED
}
public plugin_precache()
{
new rsFile[128],s[128],i
get_configsdir(rsFile, 128)
format(rsFile, 128 ,"%s/roundsound.ini", rsFile) // should be something like addons/amxmodx/configs/
i=fopen(rsFile,"rt")
gCount=0
if(i==0){
log_amx("Error loading config file! [%s]", rsFile)
} else {
while (!feof(i)) // Reading rs config from roundsound.ini
{
fgets(i,s,128)
trim(s)
if(s[0]!=0) {
log_amx("Loaded [%s]", s);
copy(gFiles[gCount], 128, s)
gCount++
}
}
fclose(i)
}
for(i=0;i<gCount;i++)
{
format(s, 200, "%s%s", cSoundsDir, gFiles[i])
precache_generic(s)
}
log_amx("Loaded music files: %d", gCount)
return PLUGIN_CONTINUE
}
public play_any_sound(sound[])
{
new is_mpeg = ( containi(sound, ".mp3") != -1 )
if ( is_mpeg )
client_cmd(0, "mp3 play ^"%s%s^"", cSoundsDir, sound)
else
client_cmd(0, "spk ^"%s%s^"", cSoundsDir, sound)
}
001.mp3
002.mp3
Napisano 24.03.2010 13:12
Napisano 24.03.2010 21:24
Użytkownik roofi07 edytował ten post 24.03.2010 23:41
0 użytkowników, 0 gości, 0 anonimowych