- Поддерживаемые игры
-
- CS: Source (OrangeBox)
- CS: Source (v34)
Colors
Функции для легкого управления цветом чата
Функции для легкого управления цветом чата
Описание:
Этот файл позволяет разработчикам легко управлять цветами шрифта чата в различных игровых модах, использовать теги цветов, использовать теги в файлах перевода и автоматически заменять цвета в моде, которые не поддерживают их (любой цвет, который не поддерживается, будет заменен на зеленый цвет).
Функции:
- CPrintToChat
- CPrintToChatAll
- CPrintToChatEx
- CPrintToChatAllEx
- CRemoveTags
- CSkipNextClient
PHP:
/**
* Prints a message to a specific client in the chat area.
* Supports color tags.
*
* @param client Client index.
* @param szMessage Message (formatting rules).
* @return No return
*
* On error/Errors: If the client is not connected an error will be thrown.
*/
stock CPrintToChat(client, const String:szMessage[], any:...)
/**
* Prints a message to all clients in the chat area.
* Supports color tags.
*
* @param client Client index.
* @param szMessage Message (formatting rules)
* @return No return
*/
stock CPrintToChatAll(const String:szMessage[], any:...)
Tags: {default}, {green}, {yellow}, {lightgreen}, {red}, {blue}, {olive}.
Основные цвета: default, green (желтый в L4D), olive.
Командные цвета: lightgreen, red, blue.
Таблица цветов:

Примечания:
- You can use only one team color (like lightgreen, red or blue) in the message.
- In hl2dm colors are different for classic deathmatch and team deathmatch.
- If some color is not supported by the mod it will be automatically replaced with green
- You can use these functions instead of default SM function, they are supports formatting (%d, %s, %t, etc.)
- Green color is yellow in L4D and yellow is green in all other games. You can use tag that you prefer.
- There must be at least one player in each team for proper red and blue colors working. Otherwise these tags will be replaced with green.
PHP:
/**
* Prints a message to a specific client in the chat area.
* Supports color tags and teamcolor tag.
*
* @param client Client index.
* @param author Author index whose color will be used for teamcolor tag.
* @param szMessage Message (formatting rules).
* @return No return
*
* On error/Errors: If the client or author are not connected an error will
* be thrown.
*/
stock CPrintToChatEx(client, author, const String:szMessage[], any:...)
/**
* Prints a message to all clients in the chat area.
* Supports color tags and teamcolor tag.
*
* @param author Author index whos color will be used for teamcolor tag.
* @param szMessage Message (formatting rules).
* @return No return
*
* On error/Errors: If the author is not connected an error will
* be thrown.
*/
stock CPrintToChatAllEx(author, const String:szMessage[], any:...)
Основные цвета: default, green (желтый в L4D), olive.
Командные цвета: based on author's team color.
Примечания:
- Author index is any client index whose team color you want to be used for {teamcolor} tag
- Tag {teamcolor} replaces {red}, {blue} and {lightgreen} tags
- All notes for regular functions are used for these function too.
PHP:
/**
* Removes color tags from the string.
*
* @param szMessage String.
* @param maxlength Maximum length of the string buffer.
* @return No return
*/
stock CRemoveTags(String:szMessage[], maxlength)
/**
* This function should only be used right in front of
* CPrintToChatAll or CPrintToChatAllEx and it tells
* to those funcions to skip specified client when printing
* message to all clients. After message is printed client will
* no more be skipped.
*
* @param client Client index
* @return No return
*/
stock CSkipNextClient(client)