BANNED
Join Date: Sep 2009
Location: Cordoba,Argentina
|
12-01-2009
, 12:00
Re: [color chat]
|
#3
|
Quote:
Originally Posted by K.K.Lv
Hi everyone, I just make another code can show color chat, I test it ,and work well, so I post it and hope some one can point out the bug if there is(are) bug(s), or if you think this code is so bad, please give me some good code than this ! because I don't think this topic and this topic is so good !
Note that: I come here for learning , so don't say anything hurt some one ! you can post your opinion here !
Thx all !!!
PHP Code:
public print_color(id, cid, color, message[]) { new team[32] get_user_team(cid, team, 31) switch (color) { case 0: msg_teaminfo(cid, team) case 1: msg_teaminfo(cid, "TERRORIST") case 2: msg_teaminfo(cid, "CT") case 3: msg_teaminfo(cid, "SPECTATOR") } if (id) msg_saytext(id, cid, message) else msg_saytext(0, cid, message) if (color != 0) msg_teaminfo(cid, team) } msg_saytext(id, cid, msg[]) { message_begin(id?MSG_ONE:MSG_ALL, get_user_msgid("SayText"), {0,0,0}, id) write_byte(cid) write_string(msg) message_end() } msg_teaminfo(id, team[]) { message_begin(MSG_ONE, get_user_msgid("TeamInfo"), {0,0,0}, id) write_byte(id) write_string(team) message_end() }
color settings:
0 -- Don't change
1 -- Red color
2 -- Blue color
3 -- Grey color
|
PHP Code:
stock ChatColor(const id, const input[], any:...) { new count = 1, players[32] static msg[191] vformat(msg, 190, input, 3) replace_all(msg, 190, "!g", "^4") // Green Color replace_all(msg, 190, "!y", "^1") // Default Color replace_all(msg, 190, "!team", "^3") // Team Color replace_all(msg, 190, "!team2", "^0") // Team2 Color if (id) players[0] = id; else get_players(players, count, "ch") { for (new i = 0; i < count; i++) { if (is_user_connected(players[i])) { message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]) write_byte(players[i]); write_string(msg); message_end(); } } } }
This was done by kiske...
I just brought it to this thread
|
|