Тут есть 2 способа:
использывать colorchat.inc (но ты скорее всего будеш пихать рекламку в сервер и выкладывать его в сеть, поэтому можно обоитись и без этого)
Код
#include <amxmisc>
#define PLUGIN "123"
#define VERSION "1.0"
#define AUTHOR "TTuCTOH"
enum ChatColor
{
CHATCOLOR_YELLOW = 1, // Yellow
CHATCOLOR_GREEN, // Green Color
CHATCOLOR_TEAM_COLOR, // Red, grey, blue
CHATCOLOR_GREY, // grey
CHATCOLOR_RED, // Red
CHATCOLOR_BLUE, // Blue
}
new g_TeamName[][] =
{
"",
"TERRORIST",
"CT",
"SPECTATOR"
}
new g_msgSayText
new g_msgTeamInfo
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
g_msgSayText = get_user_msgid("SayText")
g_msgTeamInfo = get_user_msgid("TeamInfo")
}
public client_putinserver(id)
{
set_task(15.0, "advert", id)
}
public advert(id)
{
colorChat(id, CHATCOLOR_GREEN, "^0x04Welcome to Classic Server")
colorChat(id, CHATCOLOR_GREEN, "^0x04Site www.c-s.net.ua")
}
colorChat(id, ChatColor:color, const msg[], {Float,Sql,Result,_}:...)
{
new team, index, MSG_Type
new bool:teamChanged = false
new message[192]
switch(color)
{
case CHATCOLOR_YELLOW: // Yellow
{
message[0] = 0x01;
}
case CHATCOLOR_GREEN: // Green
{
message[0] = 0x04;
}
default: // Grey, Red, Blue
{
message[0] = 0x03;
}
}
vformat(message[1], 190, msg, 4);
if (id == 0)
{
index = findAnyPlayer();
MSG_Type = MSG_ALL;
}
else
{
index = id;
MSG_Type = MSG_ONE;
}
if (index != 0)
{
team = get_user_team(index);
if (color == CHATCOLOR_RED && team != 1)
{
messageTeamInfo(index, MSG_Type, g_TeamName[1])
teamChanged = true
}
else if (color == CHATCOLOR_BLUE && team != 2)
{
messageTeamInfo(index, MSG_Type, g_TeamName[2])
teamChanged = true
}
else if (color == CHATCOLOR_GREY && team != 0)
{
messageTeamInfo(index, MSG_Type, g_TeamName[0])
teamChanged = true
}
messageSayText(index, MSG_Type, message);
if (teamChanged)
{
messageTeamInfo(index, MSG_Type, g_TeamName[team]);
}
}
}
messageSayText(id, type, message[])
{
message_begin(type, g_msgSayText, _, id)
write_byte(id)
write_string(message)
message_end()
}
messageTeamInfo(id, type, team[])
{
message_begin(type, g_msgTeamInfo, _, id)
write_byte(id)
write_string(team)
message_end()
}
findAnyPlayer()
{
new players[32], inum
get_players(players, inum)
for (new a = 0; a < inum; ++a)
{
if(is_user_connected(players[a]))
return players[a];
}
return 0
}