Code:
new const g_sounds[][] =
{
"voi/elo.wav",
"voi/siema.wav",
"voi/siemano.wav"
}
new const g_teamattack_sounds[][] =
{
"tk1.wav",
"tk2.wav",
"tk3.wav",
"tk4.wav"
}
new const g_attack_sounds[][]=
{
"voi/wqrw5.wav",
"voi/wqrw4.wav",
"voi/wqrw2.wav",
"voi/wqrw3.wav",
"voi/wqrw6.wav",
"voi/wqrw7.wav",
"voi/wqrw8.wav",
"voi/wqrw1.wav",
"voi/taunt5.wav",
"voi/taunt2.wav",
"voi/taunt4.wav",
"voi/taunt3.wav",
"voi/taunt1.wav",
"voi/okurwa.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")
}
for(new i = 0; i < sizeof g_attack_sounds; i++)
{
if(!precache_sound(g_atac_sounds[i]))
{
log_amx("Error: Could not precache (%s), plugin stopped.",
g_atac_sounds[i])
pause("ad")
}
public say_elo_handle(id,0)
{
play_sound(id, 0)
}
public say_siema_handle(id,1)
{
play_sound(id, 1)
}
public say_siemano_handle(id,2)
{
play_sound(id, 2)
}
public play_sounds(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, atac)
{
if(TA
if(attack
emit_sound(victim, CHAN_VOICE, g_teamattack_sounds[random_num(0, sizeof
g_teamattack_sounds - 1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
}
emit_sound(victim, CHAN_VOICE, g_attack_sound[random_num(0, sizeof
g_atac_sound - 1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
}