Доброго времени суток, господа!
Есть плагин который при входе игрока ТОП-1 воспроизводит звук и пишет в чат.
Может кто-то сделать так что бы плагин реагировал на каждого кто в топ-10?
Код
#include <amxmodx>
#include <csx>
new SayText
public plugin_init()
{
register_plugin( "top1", "1.0", "AUTHOR" )
}
public client_putinserver(id)
{
set_task( 3.0, "taskCheck", id )
SayText = get_user_msgid("SayText")
}
public taskCheck(id)
{
new sOsef[8];
new iRank = get_user_stats(id, sOsef, sOsef);
static szName[34];
if ( iRank == 1 )
{
get_user_name(id, szName, 32);
ChatColor ( 0 , "!gТрепещите! На сервер зашёл топ1 !team %s ", szName );
client_cmd(0,"spk ambience/thunder_clap")
}
}
stock ChatColor(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4")
replace_all(msg, 190, "!y", "^1")
replace_all(msg, 190, "!team", "^3")
if (id) players[0] = id
else get_players(players, count, "ch")
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, SayText, _, players[i])
write_byte(players[i])
write_string(msg)
message_end()
}
}
return PLUGIN_CONTINUE
}