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

Change TAG position in chat (CSGO)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
combocarte112
Senior Member
Join Date: Jun 2016
Location: Romania
Old 03-29-2020 , 05:29   Change TAG position in chat (CSGO)
Reply With Quote #1

Hello, how i can change TAG position in chat, i want to be in front of the name. (CSGO)


Code:
public Action OnChatMessage(int& iClient, ArrayList recipients, eChatFlags& flag, char[] name, char[] message, bool& bProcessColors, bool& bRemoveColors)
{
	if(colors[iClient])
	{
		Format(name, MAXLENGTH_NAME, " %s%s%s%s", tag_Color[iClient], tag[iClient], name_Color[iClient], name);
		Format(message, (MAXLENGTH_MESSAGE - strlen(name) - 5), "%s%s", chat_Color[iClient], message);
		bProcessColors = false;
		return Plugin_Changed;
	}
	return Plugin_Continue;
}
combocarte112 is offline
Send a message via Skype™ to combocarte112
Chrissy
Member
Join Date: May 2013
Old 03-30-2020 , 12:13   Re: Change TAG position in chat (CSGO)
Reply With Quote #2

Format the name do have the name before the tag inside of the name string.

This is my code for a tag plugin I made, so take from it what you will:
Code:
public Action CP_OnChatMessage(int& iAuthor, ArrayList hRecipients, char[] sFlagString, char[] sName, char[] sMessage, bool& bProcessColours, bool& bRemoveColours)
{
	if(!IsValidClient(iAuthor))
	{
		return Plugin_Continue;
	}
	
	bProcessColours = false;
	
	char sNameBuffer[MAXLENGTH_MESSAGE * 2];
	
	Format(sNameBuffer, sizeof(sNameBuffer), " ");
	
	if(g_bWarden)
	{
		if(JailbreakWarden_IsWarden(iAuthor))
		{
			Format(sNameBuffer, sizeof(sNameBuffer), "%s{default}[{darkblue}W{default}] ", sNameBuffer);
		}
	}

	if(g_iTagFlags[iAuthor] & TAG_LOADED && !(g_iTagFlags[iAuthor] & TAG_HIDECUSTOM))
	{
		Format(sNameBuffer, sizeof(sNameBuffer), "%s{default}[%s{default}] ", sNameBuffer, g_sTagFormatString[iAuthor]);
	}
	
	switch(GetClientTeam(iAuthor))
	{
		case 0, 1:
		{
			char sRawName[MAX_NAME_LENGTH];
			GetClientName(iAuthor, sRawName, sizeof sRawName);
			
			CRemoveColors(sRawName, MAX_NAME_LENGTH);
			RemoveColourCodes(sRawName, MAX_NAME_LENGTH);
		
			Format(sNameBuffer, sizeof(sNameBuffer), "%s{default}%s", sNameBuffer, sRawName);
		}
		
		default:
		{
			char sRawName[MAX_NAME_LENGTH];
			GetClientName(iAuthor, sRawName, sizeof sRawName);
			
			CRemoveColors(sRawName, MAX_NAME_LENGTH);
			RemoveColourCodes(sRawName, MAX_NAME_LENGTH);
		
			Format(sNameBuffer, sizeof(sNameBuffer), "%s{teamcolor}%s", sNameBuffer, sRawName);
		}
	}
	
	CRemoveColors(sMessage, MAXLENGTH_MESSAGE);
	RemoveColourCodes(sMessage, MAXLENGTH_MESSAGE);
	
	Format(sMessage, MAXLENGTH_MESSAGE, "{default}%s", sMessage);
	
	CProcessVariables(sNameBuffer, sizeof(sNameBuffer));
	CProcessVariables(sMessage, MAXLENGTH_MESSAGE);
	
	Format(sName, MAXLENGTH_NAME, sNameBuffer);
	
	return Plugin_Changed;
}
I'm using chat processor plugin.

Last edited by Chrissy; 03-30-2020 at 12:13.
Chrissy is offline
FreezerPT
Senior Member
Join Date: Mar 2017
Location: 127.0.0.1
Old 03-30-2020 , 18:43   Re: Change TAG position in chat (CSGO)
Reply With Quote #3

Quote:
Originally Posted by Chrissy View Post
Format the name do have the name before the tag inside of the name string.

This is my code for a tag plugin I made, so take from it what you will:
Code:
public Action CP_OnChatMessage(int& iAuthor, ArrayList hRecipients, char[] sFlagString, char[] sName, char[] sMessage, bool& bProcessColours, bool& bRemoveColours)
{
	if(!IsValidClient(iAuthor))
	{
		return Plugin_Continue;
	}
	
	bProcessColours = false;
	
	char sNameBuffer[MAXLENGTH_MESSAGE * 2];
	
	Format(sNameBuffer, sizeof(sNameBuffer), " ");
	
	if(g_bWarden)
	{
		if(JailbreakWarden_IsWarden(iAuthor))
		{
			Format(sNameBuffer, sizeof(sNameBuffer), "%s{default}[{darkblue}W{default}] ", sNameBuffer);
		}
	}

	if(g_iTagFlags[iAuthor] & TAG_LOADED && !(g_iTagFlags[iAuthor] & TAG_HIDECUSTOM))
	{
		Format(sNameBuffer, sizeof(sNameBuffer), "%s{default}[%s{default}] ", sNameBuffer, g_sTagFormatString[iAuthor]);
	}
	
	switch(GetClientTeam(iAuthor))
	{
		case 0, 1:
		{
			char sRawName[MAX_NAME_LENGTH];
			GetClientName(iAuthor, sRawName, sizeof sRawName);
			
			CRemoveColors(sRawName, MAX_NAME_LENGTH);
			RemoveColourCodes(sRawName, MAX_NAME_LENGTH);
		
			Format(sNameBuffer, sizeof(sNameBuffer), "%s{default}%s", sNameBuffer, sRawName);
		}
		
		default:
		{
			char sRawName[MAX_NAME_LENGTH];
			GetClientName(iAuthor, sRawName, sizeof sRawName);
			
			CRemoveColors(sRawName, MAX_NAME_LENGTH);
			RemoveColourCodes(sRawName, MAX_NAME_LENGTH);
		
			Format(sNameBuffer, sizeof(sNameBuffer), "%s{teamcolor}%s", sNameBuffer, sRawName);
		}
	}
	
	CRemoveColors(sMessage, MAXLENGTH_MESSAGE);
	RemoveColourCodes(sMessage, MAXLENGTH_MESSAGE);
	
	Format(sMessage, MAXLENGTH_MESSAGE, "{default}%s", sMessage);
	
	CProcessVariables(sNameBuffer, sizeof(sNameBuffer));
	CProcessVariables(sMessage, MAXLENGTH_MESSAGE);
	
	Format(sName, MAXLENGTH_NAME, sNameBuffer);
	
	return Plugin_Changed;
}
I'm using chat processor plugin.
I'am trying to find a plugin that make somethins like that! [Admin] FreezerPT: chat here, and I try many plugins, but anyone works! Can you tell me what are you using? Or can you pass me your code pls
__________________
FreezerPT is offline
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 11:07.


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