Raised This Month: $32 Target: $400
 8% 

Colorchat ^3 showing wrong team color


Post New Thread Reply   
 
Thread Tools Display Modes
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 05-18-2019 , 17:37   Re: Colorchat ^3 showing wrong team color
Reply With Quote #21

Quote:
Originally Posted by edon1337 View Post
What do you mean the team name? Is there a native that returns team name as a string?
get_user_team does, yeah. In HL teams are based on player model and could be anything.

No reason not to use cs_get_user_team when the colorchat works only on CS though.
__________________

Last edited by <VeCo>; 05-18-2019 at 17:38.
<VeCo> is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-18-2019 , 17:52   Re: Colorchat ^3 showing wrong team color
Reply With Quote #22

Look at get_user_team in the API - it has 2 more arguments for the actual name.

@VeCo - I use it because the TeamInfo message uses the team name directly rather than a number or CS_TEAM constant.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 05-19-2019 , 07:58   Re: Colorchat ^3 showing wrong team color
Reply With Quote #23

I tried adding
PHP Code:
                                CC_SendMatched0id"&x04%s &x03%s&x01: &x04%s"g_iItemsPlayer_Prefix ], szNameszArgs );
                                
                                new 
szTeam32 ];
                                new 
iTeam get_user_teamidszTeamcharsmaxszTeam ) );
                                
                                
client_printidprint_chat"Team ID: %d | Team Name: %s"iTeamszTeam ); 
It didn't bug for me at all, everything worked correctly.
But a player said (he was T) that he was seeing his own chat color as blue (it was showing me that he had red).
__________________

Last edited by edon1337; 05-19-2019 at 08:31.
edon1337 is offline
Old 05-20-2019, 09:07
Natsheh
This message has been deleted by Natsheh.
husam124
Member
Join Date: Jul 2017
Location: Palestine
Old 05-27-2019 , 16:08   Re: Colorchat ^3 showing wrong team color
Reply With Quote #24

Quote:
Originally Posted by edon1337 View Post
I tried adding
PHP Code:
                                CC_SendMatched0id"&x04%s &x03%s&x01: &x04%s"g_iItemsPlayer_Prefix ], szNameszArgs );
                                
                                new 
szTeam32 ];
                                new 
iTeam get_user_teamidszTeamcharsmaxszTeam ) );
                                
                                
client_printidprint_chat"Team ID: %d | Team Name: %s"iTeamszTeam ); 
It didn't bug for me at all, everything worked correctly.
But a player said (he was T) that he was seeing his own chat color as blue (it was showing me that he had red).
use #include "ColorChat" instead of "CromChat"
and make it this way .

formatex(szPrefix,charsmax( szPrefix ),"^x04[%s]%s:%s",g_iItems[ Player_Prefix ], szName, szArgs)

i made it like that with my knife mod server and works perfectly.

[EDIT]: That not means that cromchat is bad only it worked with me in colorchat.
__________________
supreme being bow to me humans

Last edited by husam124; 05-27-2019 at 16:13. Reason: i thought it will make oxcirom angry
husam124 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-27-2019 , 17:17   Re: Colorchat ^3 showing wrong team color
Reply With Quote #25

Quote:
Originally Posted by husam124 View Post
use #include "ColorChat" instead of "CromChat"
and make it this way .

formatex(szPrefix,charsmax( szPrefix ),"^x04[%s]%s:%s",g_iItems[ Player_Prefix ], szName, szArgs)

i made it like that with my knife mod server and works perfectly.

[EDIT]: That not means that cromchat is bad only it worked with me in colorchat.
ColorChat is not in any way better than CromChat. The point of CromChat is to fix the bugs that ColorChat has, so this is not a solution. ColorChat often mixes up the team colors. Also, your code doesn't even use the team color, so of course it won't have any bugs.
__________________

Last edited by OciXCrom; 05-27-2019 at 17:18.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
husam124
Member
Join Date: Jul 2017
Location: Palestine
Old 05-28-2019 , 03:48   Re: Colorchat ^3 showing wrong team color
Reply With Quote #26

Quote:
Originally Posted by OciXCrom View Post
ColorChat is not in any way better than CromChat. The point of CromChat is to fix the bugs that ColorChat has, so this is not a solution. ColorChat often mixes up the team colors. Also, your code doesn't even use the team color, so of course it won't have any bugs.
tem color is simply to add ^3 before the text
and if you can see above i said that it not means that crom chat is bad please read all my msg and see the end of it.
if he want team colour:-
formatex(szPrefix,charsmax( szPrefix ),"^x04[%s]^x03%s:^x04%s",g_iItems[ Player_Prefix ], szName, szArgs)

in fact:i have knife mod server all it plugins made by you.
knife xp,prefix,remove imm,happyhour,etc.
__________________
supreme being bow to me humans

Last edited by husam124; 05-28-2019 at 03:51.
husam124 is offline
husam124
Member
Join Date: Jul 2017
Location: Palestine
Old 05-28-2019 , 03:53   Re: Colorchat ^3 showing wrong team color
Reply With Quote #27

here is simple example
Code:
public handleSayText(msgId, msgDest, msgEnt,item)
{
	new id = get_msg_arg_int(1);
	if(is_user_connected(id))
	{
		new szTmp[256],
		szTmp2[256];
		
		get_msg_arg_string(2, szTmp, charsmax(szTmp));
		
		new szPrefix[64]
		formatex(szPrefix,charsmax( szPrefix ),"^x04[%s]^x03%s:^x04%s",g_iItems[ Player_Prefix ], szName, szTmp)			
		if(!equal(szTmp, "#Cstrike_Chat_All"))
		{
			add(szTmp2, charsmax(szTmp2), szPrefix);
			add(szTmp2, charsmax(szTmp2), " ");
			add(szTmp2, charsmax(szTmp2), szTmp);
		}
		else
		{
			add(szTmp2, charsmax(szTmp2), szPrefix);
			add(szTmp2, charsmax(szTmp2), "^x03 %s1^x01 :  %s2");
		}
		set_msg_arg_string(2, szTmp2);
	}
}
__________________
supreme being bow to me humans

Last edited by husam124; 05-28-2019 at 03:59.
husam124 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-28-2019 , 07:41   Re: Colorchat ^3 showing wrong team color
Reply With Quote #28

You're not even using colorchat in the code.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
husam124
Member
Join Date: Jul 2017
Location: Palestine
Old 05-28-2019 , 10:29   Re: Colorchat ^3 showing wrong team color
Reply With Quote #29

Quote:
Originally Posted by OciXCrom View Post
You're not even using colorchat in the code.
^x03 = team color msg.
^x01 = normal color msg.
^x04 = green color msg.
how im not using colorchat
and colorchat not always means #include <colorchat>
maybe i want to make it stock colorchat.
__________________
supreme being bow to me humans
husam124 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-28-2019 , 12:32   Re: Colorchat ^3 showing wrong team color
Reply With Quote #30

I don't see any ColorChat function in your code. You're putting the color symbols in the "formatex" function and sending the message via "set_msg_arg_string". At no point are you sending a message with the "ColorChat" stock.
__________________

Last edited by OciXCrom; 05-28-2019 at 12:33.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Reply


Thread Tools
Display Modes

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 05:50.


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