Czy dałoby radę przerobić plugin tak, by po wpisaniu "siema" słyszeli go wszyscy na serwerze?
#include <amxmodx> #include <amxmisc> new const PLUGIN[] = "Ewelinka Sounds" new const VERSION[] = "1.0" new const AUTHOR[] = "stupok69" new const g_sounds[][] = { "misc/elo.wav", "misc/siema.wav", "misc/siemano.wav" } new const g_teamattack_sounds[][] = { "misc/tk1.wav", "misc/tk2.wav", "misc/tk3.wav", "misc/tk4.wav" } new g_maxplayers public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_clcmd("say elo", "say_elo_handle") register_clcmd("say siema", "say_siema_handle") register_clcmd("say siemano", "say_siemano_handle") g_maxplayers = get_maxplayers() + 1 } public plugin_precache() { for(new i = 0; i < sizeof g_sounds; i++) { if(!precache_sound(g_sounds[i])) { log_amx("* Error: Could not precache (%s), plugin stopped.", g_sounds[i]) pause("ad") } } for(new i = 0; i < sizeof g_teamattack_sounds; i++) { if(!precache_sound(g_teamattack_sounds[i])) { log_amx("* Error: Could not precache (%s), plugin stopped.", g_teamattack_sounds[i]) pause("ad") } } } public say_elo_handle(id) { play_sound(id, 0) } public say_siema_handle(id) { play_sound(id, 1) } public say_siemano_handle(id) { play_sound(id, 2) } public play_sound(id, soundid) { static buffer[64] format(buffer, 63, "sound/%s", g_sounds[soundid]) if(is_user_alive(id)) { for(new i = 0; i < g_maxplayers; i++) { if(is_user_connected(i)) { console_cmd(id, "spk %s", buffer) } } } else { for(new i = 0; i < g_maxplayers; i++) { if(is_user_connected(i) && !is_user_alive(i)) { console_cmd(id, "spk %s", buffer) } } } return PLUGIN_HANDLED } public client_damage(attacker, victim, damage, wpnindex, hitplace, TA) { if(TA) { emit_sound(victim, CHAN_VOICE, g_teamattack_sounds[random_num(0, sizeof g_teamattack_sounds - 1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM) } }