Quote:
Originally Posted by ConnorMcLeod
The 1st one requires to install a client, can't find the 2nd one, but if it is also needs a client, this is why a simple addon can't do the same.
|
I am unfamiliar with what you mean by 'install a client'
as for the 2nd one, it was not publicly released and was only mad available to a very small amount of people, if I can find my copy, I will post a link.
I have done research on how messages are sent, I can make my own msgtext and start it with "STX(Team) %NAME%: %s" or "STX%NAME%: %s" and have everything before the semi-colon colored, I havent had any luck if I modify the first in any other way, if I do change the team I am on to team 4 (which is a valid team in TFC), unfortunately if I do this, I will need to delay the text or else it will use the old team color..
here is what I have come up with so far.
PHP Code:
#include <amxmodx>
#include <engine>
#define MAX_CHAT_LEN 128//client.cpp line343
new msgChat
new g_team[33];
public plugin_init()
{
register_plugin("colorchat test", "0.0.1", "Master");
register_clcmd("say", "colourchat")
register_clcmd("cc_test", "cc_test")
msgChat=get_user_msgid("SayText")
}
public cc_test(id)
{
new name[33]
get_user_name(id, name, 32)
//client_print_color2(0, id, "%s ^1Color ^3Color", name)
new text[128]
format(text, charsmax(text), "%s: This is a test", name);
new team = entity_get_int(id, EV_INT_team);
entity_set_int(id, EV_INT_team, 4);
msg_say(id, text);
set_task(0.1, "reset_team", id+818);
g_team[id] = team;
format(text, charsmax(text), "(Team) %s: This is a second test.", name);
msg_say(id, text);
new buf[10] = "Text Line"
format(text, charsmax(text), "%s: Text 3", buf);
msg_say(id, text);
//entity_set_int(id, EV_INT_team, team);
/* else
{
client_print(id, print_chat, "%s: ERROR! team not right, trying again!");
cc_test(id)
} */
//entity_set_int(id, EV_INT_team, team);
}
public reset_team(id)
{
id-=818
new team = entity_set_int(id, EV_INT_team, g_team[id]);
client_print(id, print_chat, "reset team to %d", team)
}
public colourchat(id)
{
new name[33]
get_user_name(id, name, 32)
new said[128]
read_args(said, charsmax(said))
remove_quotes(said)
new text[300]
format(text, charsmax(text), "%s: %s", name, said);//7
//colors only working on name part, thats fine.
// = team color
//
//client_print_color(id, DontChange, "^4%s^2%s",name,said)
//client_print_color(id, DontChange, "%s : %s", name, said)
msg_say(id, text);
return PLUGIN_HANDLED
}
msg_say(id,txt[])
{
format(txt, MAX_CHAT_LEN, "%s^n", txt);
message_begin(MSG_BROADCAST,msgChat)
write_byte(id)
write_string(txt)
message_end()
//client_print(0, print_chat, "id:%d txt:%s", id, txt);
}
I had plans on using something like this for my global chat system (similar to kost's crossserver-adminchat) I imagine this can be achieved by creating a temporary fakeclient name (%servername%) %clientname% and assigning them to team 4 (green color) so messages would appear as follows:
(My Server) Player:
Hello Users!
I am unfortunately really bad at this, is there some way I can easily do this without creating a connect message or a namechange message? if not, I am sure I can block the message from within the plugin itself, but nonetheless I know very little about fake clients. any help?
__________________