AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   [INC] Colors (1.0.5) (https://forums.alliedmods.net/showthread.php?t=96831)

dordnung 01-30-2013 12:59

[INC] Colors (1.1)
 
5 Attachment(s)
Updated Colors

I added the Tags "{darkred}", "{lime}" and "{lightred}" for Counter-Strike: Global Offensive

These tags are standalone tags, so they can be used with teamcolors!


You can use:

PHP Code:

CPrintToChatAll("{blue}Blue Part and {darkred}Darkred Part {lime}and Lime"

but not:

PHP Code:

CPrintToChatAll("{blue}Blue Part and {red}Red Part"


Also i added a stock, which checks, whether a tag is supported by the game or not

PHP Code:

stock CColorAllowed(Colors:color


And a stock, which can replace a color with another one (to replace non supported colors)

PHP Code:

stock CReplaceColor(Colors:colorColors:newColor


Example:

PHP Code:

if (!CColorAllowed(Color_Lightgreen) && CColorAllowed(Color_Lime))
    
CReplaceColor(Color_LightgreenColor_Lime); 


For the Colors:color parameters use:

PHP Code:

Color_Default
Color_Darkred
Color_Green
Color_Lightgreen
Color_Red
Color_Blue
Color_Olive
Color_Lime
Color_Lightred 


eric0279 02-07-2013 11:41

Re: [INC] Colors (1.0.5)
 
Hello,

is it possible to add a function to put color ReplyToCommand?

BomBaSK 02-12-2013 09:41

Re: [INC] Colors (1.0.5)
 
Hello, i have problem with compiling plugin when i used CPrintToChatEx (with CPrintToChat no problem). Anyone knows why?
"error 035: argument type mismatch <argument 2>"

dordnung 02-12-2013 10:35

Re: [INC] Colors (1.0.5)
 
Maybe you should post your code?

BomBaSK 02-12-2013 12:02

Re: [INC] Colors (1.0.5)
 
Quote:

Originally Posted by Popoklopsi (Post 1893012)
Maybe you should post your code?

PHP Code:

public Action:Timer_Welcome(Handle:timerany:client)
{
    if (
IsClientConnected(client) && IsClientInGame(client))
    {
        
CPrintToChatEx(client"%T""WelcomeMsg"LANG_SERVERclient);
    }


Compile error


PHP Code:

public Action:Timer_Welcome(Handle:timerany:client)
{
    if (
IsClientConnected(client) && IsClientInGame(client))
    {
        
CPrintToChat(client"%T""WelcomeMsg"LANG_SERVERclient);
    }


No problems -.-"

minimoney1 02-12-2013 12:14

Re: [INC] Colors (1.0.5)
 
Quote:

Originally Posted by BomBaSK (Post 1893058)
PHP Code:

public Action:Timer_Welcome(Handle:timerany:client)
{
    if (
IsClientConnected(client) && IsClientInGame(client))
    {
        
CPrintToChatEx(client"%T""WelcomeMsg"LANG_SERVERclient);
    }


Compile error


PHP Code:

public Action:Timer_Welcome(Handle:timerany:client)
{
    if (
IsClientConnected(client) && IsClientInGame(client))
    {
        
CPrintToChat(client"%T""WelcomeMsg"LANG_SERVERclient);
    }


No problems -.-"

CPrintToChatEx takes two int parameters first. The second one is the author, meaning:
CPrintToChatEx(client, client, "My Text");
would work

BomBaSK 02-12-2013 13:33

Re: [INC] Colors (1.0.5)
 
Quote:

Originally Posted by minimoney1 (Post 1893065)
CPrintToChatEx takes two int parameters first. The second one is the author, meaning:
CPrintToChatEx(client, client, "My Text");
would work

Thanks! Now its working perfectly.

BomBaSK 02-13-2013 16:27

Re: [INC] Colors (1.0.5)
 
Quote:

Originally Posted by minimoney1 (Post 1893065)
CPrintToChatEx takes two int parameters first. The second one is the author, meaning:
CPrintToChatEx(client, client, "My Text");
would work

Im overwriting one plugin.
And when im using.
PHP Code:

  if(mostDamage 0) {
    
CPrintToChatAllEx("{gold}Hrac {teamcolor}%s {gold}sposobil najvacsie poskodenie, {fullred}%d {gold}dmg v {fullred}%d {gold}hitoch!"g_PlayerName[mostDamagePlayer], mostDamagemostHits);
  }
  if(
mostKills 0) {
    
CPrintToChatAllEx("{gold}Najviac killov: {teamcolor}%s {gold}z {fullred}%d {gold}zabiti" ,g_PlayerName[mostKillsPlayer], mostKills);
  }


Same problem with compiling. (now using morecolors to compile).

dordnung 02-13-2013 16:35

Re: [INC] Colors (1.0.5)
 
Than post it to the morecolors thread!

BomBaSK 02-13-2013 16:58

Re: [INC] Colors (1.0.5)
 
Quote:

Originally Posted by Popoklopsi (Post 1893828)
Than post it to the morecolors thread!

Sure,
but CPrintToChatAllEx does not have same function on both includes?
Its only for teamcolor using when im correct. If i confused srry -.-" .
Thx for help.


All times are GMT -4. The time now is 22:58.

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