Today I was looking at this code starsailor.
PHP Code:
#include <amxmodx>
new MsgSayText
public plugin_init()
{
MsgSayText = get_user_msgid("SayText")
register_clcmd("say", "hook_sayteam")
register_clcmd("say_team", "hook_sayteam")
}
public hook_sayteam(id)
{
new Players[32], iPnum, iIndex, iTeam
get_players(Players, iPnum)
for (new i = 0; i < iPnum; i++)
{
iIndex = Players[i]
new Said[200]
read_args(Said,199)
remove_quotes(Said)
trim(Said)
new szName[32]
get_user_name(id, szName, 31)
iTeam = get_user_team(iIndex)
if(iIndex && get_user_team(id) == iTeam)
{
chat_color(iIndex, "!y(%d) !t%s !y: %s",iTeam == 1 ? 1 : 2,szName,Said)
}
}
return PLUGIN_HANDLED;
}
stock chat_color(const id, const string[], { Float, Sql, Resul, _ }:...)
{
new msg[191], players[32], count = 1;
vformat(msg, sizeof msg - 1, string, 3);
replace_all(msg, sizeof msg - 1, "!g", "^4")
replace_all(msg, sizeof msg - 1, "!y", "^1")
replace_all(msg, sizeof msg - 1, "!t", "^3")
if(id)
{
players[0] = id;
}
else
{
get_players(players, count, "ch")
}
for (new i = 0 ; i < count ; i++)
{
new index = players[i]
message_begin(MSG_ONE_UNRELIABLE, MsgSayText, _, index)
write_byte(index)
write_string(msg)
message_end()
}
}
Now, a problem if I try to talk to admin (@ @), the Tsay csay or not present, someone can help me?
__________________