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

[INC] Multi Colors


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bara
AlliedModders Donor
Join Date: Apr 2012
Location: Germany
Old 09-07-2014 , 16:52   [INC] Multi Colors
Reply With Quote #1

You like this plugin or my work? Support is not a crime.

Multi Colors (based on Stamm-Colors) is a summary of Colors and More Colors. Depending on the game More Colors will be used as default. Should the game be CS:GO Colors will be used. The include providing a perfect base for plugins supporting multiple games.

Functions:
  • CPrintToChat(int client, const char[] message, any ...)
  • CPrintToChatAll(const char[] message, any ...)
  • CPrintToChatEx(int client, int author, const char[] message, any ...)
  • CPrintToChatAllEx(int author, const char[] message, any ...)
  • CReplyToCommand(int author, const char[] message, any ...)
  • CReplyToCommandEx(int client, int author, const char[] message, any ...)
  • CShowActivity(int author, const char[] message, any ...)
  • CShowActivityEx(int author, const char[] tag, const char[] message, any ...)
  • CShowActivity2(int author, const char[] tag, const char[] message, any ...)
  • CPrintToChatObservers(int target, const char[] message, any ...)
  • CPrintToChatObserversEx(int target, const char[] message, any ...)
  • CRemoveTags(char[] message, int maxlen)
  • CFormatColor(char[] message, int maxlength, int author)

By using C* Functions, offers these include a good compatibility to Colors and More Colors.

Links:


If you have this error:
Quote:
addons/sourcemod/scripting/include/regex.inc(175) : error 147: new-style declarations are required
Change this line (175) in your regex.inc:
Quote:
public Extension:__ext_regex =
to this:
Quote:
public Extension __ext_regex =
Download:
https://github.com/Bara20/Multi-Colors
__________________
Discord (Bara#5006) | My Plugins (GitHub)
You like my work? Support is not a crime.

Last edited by Bara; 08-31-2020 at 15:36. Reason: Updated include to version 2.0.1
Bara is offline
Root_
Veteran Member
Join Date: Jan 2012
Location: ryssland
Old 09-07-2014 , 17:33   Re: [INC] Multi Colors - 1.0.0
Reply With Quote #2

Finally a stock that will not confuse everyone to choose proper colors include, thanks.
BTW Since all games support older colors, you'd better check for Source2009 games first and use MoreColors stock, otherwise use C_PrintToChatAll(buffer) for all other games.
__________________


dodsplugins.com - Plugins and Resources for Day of Defeat
http://twitch.tv/zadroot
Root_ is offline
Bara
AlliedModders Donor
Join Date: Apr 2012
Location: Germany
Old 09-07-2014 , 18:46   Re: [INC] Multi Colors - 1.0.0
Reply With Quote #3

Quote:
Originally Posted by Root_ View Post
BTW Since all games support older colors, you'd better check for Source2009 games first and use MoreColors stock, otherwise use C_PrintToChatAll(buffer) for all other games.
Feel free to make this (maybe over a pull request), but i can take a look later.
__________________
Discord (Bara#5006) | My Plugins (GitHub)
You like my work? Support is not a crime.
Bara is offline
zipcore
Veteran Member
Join Date: Mar 2010
Location: m_flZipcore
Old 09-08-2014 , 03:38   Re: [INC] Multi Colors - 1.0.0
Reply With Quote #4

good job mate ;)
__________________
zipcore is offline
iBradleyy
AlliedModders Donor
Join Date: Jan 2013
Old 09-20-2014 , 10:53   Re: [INC] Multi Colors - 1.0.0
Reply With Quote #5

addons\sourcemod\scripting\includes\multicolo rs.inc(414) : error 001: expected token : ";" but found "}" - Download from the GitHub.
iBradleyy is offline
Bara
AlliedModders Donor
Join Date: Apr 2012
Location: Germany
Old 09-20-2014 , 11:05   Re: [INC] Multi Colors - 1.0.0
Reply With Quote #6

Quote:
Originally Posted by iBradleyy View Post
addons\sourcemod\scripting\includes\multicolo rs.inc(414) : error 001: expected token : ";" but found "}" - Download from the GitHub.
Fixed.
__________________
Discord (Bara#5006) | My Plugins (GitHub)
You like my work? Support is not a crime.
Bara is offline
h3bus
AlliedModders Donor
Join Date: Nov 2013
Old 03-24-2015 , 06:13   Re: [INC] Multi Colors - 1.0.1
Reply With Quote #7

On CS:GO, is the specific quirk when text starts with a color handled?
Inserting \x01\x0B is needed before the color code otherwise default color is displayed.

I can't find it in the code.
h3bus is offline
Bara
AlliedModders Donor
Join Date: Apr 2012
Location: Germany
Old 03-24-2015 , 10:14   Re: [INC] Multi Colors - 1.0.1
Reply With Quote #8

Quote:
Originally Posted by h3bus View Post
On CS:GO, is the specific quirk when text starts with a color handled?
Inserting \x01\x0B is needed before the color code otherwise default color is displayed.

I can't find it in the code.
Added ;)
https://github.com/Bara20/Multi-Colo...cafb33c95aabe2
__________________
Discord (Bara#5006) | My Plugins (GitHub)
You like my work? Support is not a crime.
Bara is offline
h3bus
AlliedModders Donor
Join Date: Nov 2013
Old 03-24-2015 , 11:24   Re: [INC] Multi Colors - 1.0.1
Reply With Quote #9

Thanks! I certainly will be using this!

Just for the sake of optimisation, do you know if there is a way to hook translation system when it loads a phrase, so we do the color replacements once and for all at load time?
This would be sweet!
h3bus is offline
Bara
AlliedModders Donor
Join Date: Apr 2012
Location: Germany
Old 06-09-2015 , 05:26   Re: [INC] Multi Colors - 2.0.0
Reply With Quote #10

Updated to Version 2.0.0
  • Include requires now sourcemod 1.7 and is fully compatible with
Quote:
#pragma newdecls required



If you have this error:
Quote:
addons/sourcemod/scripting/include/regex.inc(175) : error 147: new-style declarations are required
Change this line (175) in your regex.inc:
Quote:
public Extension:__ext_regex =
to this:
Quote:
public Extension __ext_regex =
__________________
Discord (Bara#5006) | My Plugins (GitHub)
You like my work? Support is not a crime.

Last edited by Bara; 06-09-2015 at 05:37.
Bara 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 16:36.


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