Premium Реклама Spotlight Bundles Boost Банери Кредити
Основно Начало Сървъри Marketplace Форум Сървъри
Общности Хостинг Добави Auction Boost
Ресурси
Библиотеки Карти Видеа Магазин Bundles
Инструменти
Builder Demo CFG HUD
AMXX API
Вход Регистрация
TOP SERVER
[IG] Easy Surf | Ramp Fix | RANKS | REPLAYS
Counter-Strike 1.6
surf_flyin_fortress
40.160.19.36:27015
18.05 18:49
8/64
186ms
/ Библиотеки / colorchat.inc

colorchat.inc

.inc 1.7 KB 83 реда 04.04.2026
Pawn / AMX Mod X
enum Color { NORMAL = 1, GREEN,	TEAM_COLOR,	GREY, RED, BLUE }
new TeamName[][] = { "", "TERRORIST", "CT",	"SPECTATOR" }

ColorChat(id, Color:iType, const szMsg[], any:...)
{
	static szMessage[256]

	switch(iType)
	{
		case NORMAL: szMessage[0] = 0x01
		case GREEN: szMessage[0] = 0x04
		default: szMessage[0] = 0x03
	}

	vformat(szMessage[1], charsmax(szMessage), szMsg, 4)
	replace_all(szMessage, charsmax(szMessage), "!n", "^x01")
	replace_all(szMessage, charsmax(szMessage), "!t", "^x03")
	replace_all(szMessage, charsmax(szMessage), "!g", "^x04")
		
	static iTeam, ColorChange, iIndex, iMsgType
	szMessage[192] = EOS
	
	if(id)
	{
		iMsgType = MSG_ONE
		iIndex = id
	}
	else
	{
		iIndex = FindPlayer()
		iMsgType = MSG_ALL
	}
	
	iTeam = get_user_team(iIndex)
	ColorChange = ColorSelection(iIndex, iMsgType, iType)
	ShowColorMessage(iIndex, iMsgType, szMessage)
		
	if(ColorChange)
		Team_Info(iIndex, iMsgType, TeamName[iTeam])
}

ShowColorMessage(id, iType, szMessage[])
{
	message_begin(iType, get_user_msgid("SayText"), _, id)
	write_byte(id)		
	write_string(szMessage)
	message_end()
}

Team_Info(id, iType, iTeam[])
{
	message_begin(iType, get_user_msgid("TeamInfo"), _, id)
	write_byte(id)
	write_string(iTeam)
	message_end()
	return 1
}

ColorSelection(iIndex, iType, Color:Type)
{
	switch(Type)
	{
		case RED: return Team_Info(iIndex, iType, TeamName[1]);
		case BLUE: return Team_Info(iIndex, iType, TeamName[2]);
		case GREY: return Team_Info(iIndex, iType, TeamName[0]);
	}

	return 0
}

FindPlayer()
{
	static i
	i = -1

	while(i <= get_maxplayers())
	{
		if(is_user_connected(++i))
			return i;
	}

	return -1
}
РЕКЛАМИРАЙ ПРИ НАС!
AMXX-BG.INFO
КАК ДА ИЗПОЛЗВАМ
Добави в началото на .sma файла:
#include <colorchat>
1. Изтегли
Свали файла от бутона по-горе
2. Копирай
Постави в scripting/include/
3. Включи
Добави #include директивата
4. Компилирай
Използвай amxxpc или scripting/compile.exe
PrivateServ.NET