Raised This Month: $51 Target: $400
 12% 

[HL1] (Not CS) Rewriting user messages


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HLM
Senior Member
Join Date: Apr 2008
Location: C:\WINDOWS\System32
Old 10-27-2013 , 02:54   [HL1] (Not CS) Rewriting user messages
Reply With Quote #1

Is this any way possible to rewrite a message a user sends to recolor their name? I understand that colorchat is not possible in HL1, but I would like to recolor the users name to a different teams color.

is there any way of doing this? what would be the best method of trying to get this work? I have seen it done via metamod plugins, but my question is what do they have access to that we cant reach with AMXx?

if it matters, I am trying to do this in HL - TFC

any and all comments appreciated! (Except for 1 word replies! send your pessimistic spam elsewhere)
__________________
+|- KARMA Respectively

HLM is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 10-27-2013 , 02:57   Re: [HL1] (Not CS) Rewriting user messages
Reply With Quote #2

Any specific user messages?
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-27-2013 , 04:13   Re: [HL1] (Not CS) Rewriting user messages
Reply With Quote #3

If you know metamod plugins names, it can help a lot.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
HLM
Senior Member
Join Date: Apr 2008
Location: C:\WINDOWS\System32
Old 10-27-2013 , 05:16   Re: [HL1] (Not CS) Rewriting user messages
Reply With Quote #4

Quote:
Originally Posted by YamiKaitou View Post
Any specific user messages?
SayText messages? Just general chat messages.

Quote:
Originally Posted by ConnorMcLeod View Post
If you know metamod plugins names, it can help a lot.
AdminOP by Drunken F00l
ExtenTF by Voogru
__________________
+|- KARMA Respectively

HLM is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-27-2013 , 06:23   Re: [HL1] (Not CS) Rewriting user messages
Reply With Quote #5

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.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
HLM
Senior Member
Join Date: Apr 2008
Location: C:\WINDOWS\System32
Old 10-29-2013 , 04:39   Re: [HL1] (Not CS) Rewriting user messages
Reply With Quote #6

Quote:
Originally Posted by ConnorMcLeod View Post
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(idname32)
    
//client_print_color2(0, id, "%s ^1Color ^3Color", name)
    
new text[128]
    
format(textcharsmax(text), "%s: This is a test"name);
    new 
team entity_get_int(idEV_INT_team);
    
entity_set_int(idEV_INT_team4);
    
msg_say(idtext);
    
set_task(0.1"reset_team"id+818);
    
g_team[id] = team;
    
format(textcharsmax(text), "(Team) %s: This is a second test."name);
    
msg_say(idtext);
    new 
buf[10] = "Text Line"
    
format(textcharsmax(text), "%s: Text 3"buf);
    
msg_say(idtext);
    
//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(idEV_INT_teamg_team[id]);
    
client_print(idprint_chat"reset team to %d"team)
}

public 
colourchat(id)
{
    new 
name[33]
    
get_user_name(idname32)
    new 
said[128]
    
read_args(saidcharsmax(said))
    
remove_quotes(said)
    new 
text[300]
    
format(textcharsmax(text), "%s: %s"namesaid);//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(idtext);
    return 
PLUGIN_HANDLED
}

msg_say(id,txt[])
{
    
format(txtMAX_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?
__________________
+|- KARMA Respectively

HLM is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:09.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode