stock_color_message.inc

Original include source with line numbers.

Back Download .inc
1 stock ChatColor(const id, const input[], any:...)
2 {
3 new count = 1, players[32]
4 static msg[191]
5 vformat(msg, 190, input, 3)
6
7 replace_all(msg, 190, "!g", "^4") // Green Color
8 replace_all(msg, 190, "!y", "^1") // Default Color
9 replace_all(msg, 190, "!t", "^3") // Team Color
10 replace_all(msg, 190, "!w", "^0") // Team2 Color
11
12 if (id) players[0] = id; else get_players(players, count, "ch")
13 {
14 for (new i = 0; i < count; i++)
15 {
16 if (is_user_connected(players[i]))
17 {
18 message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
19 write_byte(players[i]);
20 write_string(msg);
21 message_end();
22 }
23 }
24 }
25 }