#include <amxmodx>
#define TASK_AMBIENCESOUNDS 100
public plugin_init()
{
register_plugin("Ambience Sounds", "1.0", "d")
register_clcmd("say /ahbetwq", "komut_mp3_cal")
register_clcmd("say_team /ahbetwq", "komut_mp3_cal")
}
public plugin_precache()
{
precache_generic("sound/misc/parlarkolyem.mp3")
}
public komut_mp3_cal(id)
{
new const soundFile[] = "misc/parlarkolyem.mp3"
if(file_exists(fmt("sound/%s", soundFile))) {
PlaySoundToClients(soundFile)
client_print(id, print_chat, "[Sistem] Parlar Kolye müziği çalınıyor...")
log_amx("[SOUND] %n (%d) komutu kullandı: %s ÇALINIYOR.", id, id, soundFile)
} else {
client_print(id, print_chat, "[Sistem] Hata: Ses dosyası sunucuda bulunamadı!")
log_amx("[SOUND-ERROR] %n (%d) komutu kullandı fakat dosya yok: %s", id, id, soundFile)
}
return PLUGIN_HANDLED
}
PlaySoundToClients(const sound[])
{
if (equal(sound[strlen(sound)-4], ".mp3")) {
client_cmd(0, "mp3 play ^"sound/%s^"", sound)
log_amx("[SOUND] Tum oyunculara mp3 play: sound/%s", sound)
} else {
client_cmd(0, "spk ^"%s^"", sound)
log_amx("[SOUND] Tum oyunculara spk: %s", sound)
}
}