Raised This Month: $ Target: $400
 0% 

[Source 2013] Custom Chat Colors


Post New Thread Reply   
 
Thread Tools Display Modes
maxolahird
Veteran Member
Join Date: Dec 2012
Old 02-15-2013 , 06:36   Re: [Source 2009] Custom Chat Colors
Reply With Quote #371

you know what would be nice? to set the colors only for only specific teams like

"team" "t"
"team" "ct"
"team "spec" or "all"

So you could also set multiple ones for a single person like he has a T tag, a CT tag and etc..

Last edited by maxolahird; 02-15-2013 at 08:43.
maxolahird is offline
Extent
Junior Member
Join Date: Feb 2013
Old 02-15-2013 , 11:12   Re: [Source 2009] Custom Chat Colors
Reply With Quote #372

I get this on mine


// ********************************************* ***************************
// ********************************************* ****************************
// Simple Chat Colors Config File
// Description:
// Changes the colors of players chat based on config file
// ********************************************* ****************************
// ********************************************* ****************************
// This file is part of Simple Plugins project.
//
// This plugin is free software: you can redistribute
// it and/or modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the License, or
// later version.
//
// This plugin is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this plugin. If not, see <http://www.gnu.org/licenses/>.
// ********************************************* ****************************
// ********************************************* ****************************
// How to edit this file:
// "admin_colors" <-- Leave this alone
// { <-- Add all groups/steamids after first bracket (Leave this alone)
//
//


"admin_colors"
{
//Ryan
"STEAM_0:08787972"
{
"tag" "[Admin] "
"tagcolor" "T"
"namecolor" "T"

}
}
}
} <-- Add all groups/steamids before last bracket (Leave this alone)
//
// NOTE:
// If you don't enter a steamid then the group name does not matter, it's just for your reference.
//
// For a better understanding of what these colors mean, how they work, and on what games, see this link:
// http://forums.alliedmods.net/showpos...02&postcount=2
// Thanks to everyone working on the smlib for the great .inc files!
//
// --------ORDER OF OPERATIONS--------
//
// The order in which you place items in the config file matters. Here is what determins what color they get:
// 1. SteamID
// If there is a steamid present, it will always override everything. If you put a steamid in twice
// then the first entry (top to bottom) will be used. (I think, just don't do it!)
// 2. Groups
// The plugin will search (top to bottom) for a postitive match for the flag string. The player' flags
// will be compared with the group flag string, and if the player has all the flags, it will stop there.
// For example. Admins with the "ad" flags and donators with the "a" flag. If you place the "a" flag group
// above the "d" group then the admin will get the "a" colors. Order matters.
// You can use more than 1 flag for the group. You could have made the admin group with the "ad" flag,
// but it will always take the first match.
//
// ---------DO NOT EDIT ABOVE THIS LINE---------
"admin_colors"
{
"STEAM_0:08787972"
{
"tag" "[Owner]"
"tagcolor" "{R}"
"namecolor" "{G}"
}
"Admins"
{
"flag" "z"
"tag" "[A]"
"tagcolor" "{R}"
"namecolor" "{G}"
}
"VIP"
{
"flag" "a"
"tag" "[VIP]"
"tagcolor" "{B}"
"namecolor" "{T}"
"textcolor" "{OG}"
}
}


and I still get this

(TEAM) [A]9EC34FAA[VIP] 00CCFFRyan | Extent-Hosting.com.au : 000000AAhey
Extent is offline
maxolahird
Veteran Member
Join Date: Dec 2012
Old 02-15-2013 , 13:57   Re: [Source 2009] Custom Chat Colors
Reply With Quote #373

Quote:
Originally Posted by Extent View Post
I get this on mine


// ********************************************* ***************************
// ********************************************* ****************************
// Simple Chat Colors Config File
// Description:
// Changes the colors of players chat based on config file
// ********************************************* ****************************
// ********************************************* ****************************
// This file is part of Simple Plugins project.
//
// This plugin is free software: you can redistribute
// it and/or modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the License, or
// later version.
//
// This plugin is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this plugin. If not, see <http://www.gnu.org/licenses/>.
// ********************************************* ****************************
// ********************************************* ****************************
// How to edit this file:
// "admin_colors" <-- Leave this alone
// { <-- Add all groups/steamids after first bracket (Leave this alone)
//
//


"admin_colors"
{
//Ryan
"STEAM_0:08787972"
{
"tag" "[Admin] "
"tagcolor" "T"
"namecolor" "T"

}
}
}
} <-- Add all groups/steamids before last bracket (Leave this alone)
//
// NOTE:
// If you don't enter a steamid then the group name does not matter, it's just for your reference.
//
// For a better understanding of what these colors mean, how they work, and on what games, see this link:
// http://forums.alliedmods.net/showpos...02&postcount=2
// Thanks to everyone working on the smlib for the great .inc files!
//
// --------ORDER OF OPERATIONS--------
//
// The order in which you place items in the config file matters. Here is what determins what color they get:
// 1. SteamID
// If there is a steamid present, it will always override everything. If you put a steamid in twice
// then the first entry (top to bottom) will be used. (I think, just don't do it!)
// 2. Groups
// The plugin will search (top to bottom) for a postitive match for the flag string. The player' flags
// will be compared with the group flag string, and if the player has all the flags, it will stop there.
// For example. Admins with the "ad" flags and donators with the "a" flag. If you place the "a" flag group
// above the "d" group then the admin will get the "a" colors. Order matters.
// You can use more than 1 flag for the group. You could have made the admin group with the "ad" flag,
// but it will always take the first match.
//
// ---------DO NOT EDIT ABOVE THIS LINE---------
"admin_colors"
{
"STEAM_0:08787972"
{
"tag" "[Owner]"
"tagcolor" "{R}"
"namecolor" "{G}"
}
"Admins"
{
"flag" "z"
"tag" "[A]"
"tagcolor" "{R}"
"namecolor" "{G}"
}
"VIP"
{
"flag" "a"
"tag" "[VIP]"
"tagcolor" "{B}"
"namecolor" "{T}"
"textcolor" "{OG}"
}
}


and I still get this

(TEAM) [A]9EC34FAA[VIP] 00CCFFRyan | Extent-Hosting.com.au : 000000AAhey
probably because you have used the steamid twice on the file... on the middle of the brackets and bottom.
maxolahird is offline
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 02-17-2013 , 01:15   Re: [Source 2009] Custom Chat Colors
Reply With Quote #374

MySQL module updated to v1.1.0. Fixed issues that prevented colors from being applied.
__________________
Dr. McKay is offline
Despirator
Senior Member
Join Date: Jun 2011
Location: Kazakhstan ->Shymkent
Old 02-17-2013 , 01:32   Re: [Source 2009] Custom Chat Colors
Reply With Quote #375

PHP Code:
public Native_SetTagColor(Handle:pluginnumParams) {
    new 
client GetNativeCell(1);
    if(
client || client MaxClients || !IsClientInGame(client)) {
        
ThrowNativeError(1"Invalid client or client is not in game");
        return 
false;
    }
    
decl String:color[32];
    
GetNativeString(2colorsizeof(color));
    new 
len strlen(color);
    if(
len != && len != && !StrEqual(color"G"false) && !StrEqual(color"O"false) && !StrEqual(color"T"false)) {
        return 
false;
    }
    
strcopy(tagColor[client], sizeof(tagColor[]), color);
    return 
true;

i think that
if(len != 6 && len != 8 && !StrEqual(color, "G", false) && !StrEqual(color, "O", false) && !StrEqual(color, "T", false))
is incorrect statement and should be
if(len != 6 || len != 8 || !StrEqual(color, "G", false) || !StrEqual(color, "O", false) || !StrEqual(color, "T", false))

Last edited by Despirator; 02-17-2013 at 01:33.
Despirator is offline
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 02-17-2013 , 01:50   [Source 2009] Custom Chat Colors
Reply With Quote #376

Quote:
Originally Posted by Despirator View Post
PHP Code:
public Native_SetTagColor(Handle:pluginnumParams) {
new 
client GetNativeCell(1);
if(
client || client MaxClients || !IsClientInGame(client)) {
ThrowNativeError(1"Invalid client or client is not in game");
return 
false;
}
decl String:color[32];
GetNativeString(2colorsizeof(color));
new 
len strlen(color);
if(
len != && len != && !StrEqual(color"G"false) && !StrEqual(color"O"false) && !StrEqual(color"T"false)) {
return 
false;
}
strcopy(tagColor[client], sizeof(tagColor[]), color);
return 
true;

i think that
if(len != 6 && len != 8 && !StrEqual(color, "G", false) && !StrEqual(color, "O", false) && !StrEqual(color, "T", false))
is incorrect statement and should be
if(len != 6 || len != 8 || !StrEqual(color, "G", false) || !StrEqual(color, "O", false) || !StrEqual(color, "T", false))
Nope. Your suggestion would always evaluate to true. It's impossible for a string to be 6 characters, 8 characters, "G", "O", and "T" at the same time.
__________________
Dr. McKay is offline
Despirator
Senior Member
Join Date: Jun 2011
Location: Kazakhstan ->Shymkent
Old 02-17-2013 , 09:42   Re: [Source 2009] Custom Chat Colors
Reply With Quote #377

"oh my brain what are thinking about?"
i was using an old include file and in the newest version of plugin CCC_SetTag/Name/ChatColor is deprecated, so i thought that statement was incorrect. Sorry ^^
Despirator is offline
DoctorWaffles
Junior Member
Join Date: Mar 2010
Old 02-18-2013 , 07:11   Re: [Source 2009] Custom Chat Colors
Reply With Quote #378

I am having trouble getting this to work with SQL Admins,
if I use the group name which I've placed in the SQL it won't give me the chat color/tag.

Must I add the groups to a internal (sourcemod config) file?

Last edited by DoctorWaffles; 02-18-2013 at 07:12.
DoctorWaffles is offline
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 02-18-2013 , 09:16   [Source 2009] Custom Chat Colors
Reply With Quote #379

Quote:
Originally Posted by DoctorWaffles View Post
I am having trouble getting this to work with SQL Admins,
if I use the group name which I've placed in the SQL it won't give me the chat color/tag.

Must I add the groups to a internal (sourcemod config) file?
Are you using version 1.1.0 of the MySQL module?
__________________
Dr. McKay is offline
DoctorWaffles
Junior Member
Join Date: Mar 2010
Old 02-18-2013 , 16:51   Re: [Source 2009] Custom Chat Colors
Reply With Quote #380

Ah didn't notice that, but must I create a new database for that? Or can I use the existing SQL admins database?
Or will the new database use the SQL groups?

I am having quite a lot databases, so it's quite hard for me to understand.

Last edited by DoctorWaffles; 02-18-2013 at 17:00.
DoctorWaffles 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 20:47.


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