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)

kiwi87 02-15-2010 05:25

Re: [INC] Colors (1.0.2)
 
I love the idea of being able to set the colors in the plugins i use but i'm having a problem using CPrintToAllChatEx.
CPrintToAllChat works fine though. :)

Whenever i use CPrintToAllChatEx it gives me :
error 035: argument type mismatch <argument 1>

case 2:
{
if(IsFakeClient(playerClient))
return Plugin_Continue;

CPrintToChatAllEx("{green}%N {teamcolor}joined Survivor Team.", playerClient)
}

What extra steps do i have to do to make Ex work? Teamcolor is pretty useful :)

exvel 02-15-2010 05:53

Re: [INC] Colors (1.0.2)
 
You've forgot to specify argument "author". If you want {teamcolor} to be the same color as "playerClient" you should use it like that:
PHP Code:

CPrintToChatAllEx(playerClient"{green}%N {teamcolor}joined Survivor Team."playerClient); 


kiwi87 02-15-2010 08:14

Re: [INC] Colors (1.0.2)
 
Quote:

Originally Posted by exvel (Post 1089412)
You've forgot to specify argument "author". If you want {teamcolor} to be the same color as "playerClient" you should use it like that:
PHP Code:

CPrintToChatAllEx(playerClient"{green}%N {teamcolor}joined Survivor Team."playerClient); 


Works great now, thanks! :mrgreen:

kiwi87 02-15-2010 08:57

Re: [INC] Colors (1.0.2)
 
Hello again,
Whats wrong here, i got the same error >.<

error 035: argument type mismatch <argument 1>

if (Mode > 2)
{
GetClientName(Attacker, AttackerName, sizeof(AttackerName));
CPrintToChatAllEx(AttackerName,"\x04[\x03RANK\x04] {teamcolor}%s \x01has earned \x04%i \x01points for killing%s \x05%s\x01!", AttackerName, Score, (VictimIsBot ? " a" : ""), VictimName);
}

exvel 02-15-2010 11:58

Re: [INC] Colors (1.0.2)
 
First argument should be an integer (number - that is client's index) but you have specified a player's name (string).
Also you don't have to use \x0.. codes, use color tags.

kexz 03-01-2010 14:15

Re: [INC] Colors (1.0.2)
 
Just a heads up for those using colors in uppercase - colors.inc converts string color codes only if all letters are in lower case! This should be probably fixed...

Greyscale 03-01-2010 14:30

Re: [INC] Colors (1.0.2)
 
Easy fix exvel;

Code:

native ReplaceString(String:text[], maxlength, const String:search[], const String:replace[], bool:caseSensitive=true);

psychonic 03-01-2010 14:32

Re: [INC] Colors (1.0.2)
 
Quote:

Originally Posted by kexz (Post 1104566)
Just a heads up for those using colors in uppercase - colors.inc converts string color codes only if all letters are in lower case! This should be probably fixed...

What needs fixed about it? The first post documents the tags that work. Upper case is not mentioned anywhere so there is no reason to suspect it would work. Doing a case insensitive check would just slow down the replacements.

Greyscale 03-01-2010 15:23

Re: [INC] Colors (1.0.2)
 
Since in a lot of cases the end user is using these tags, I would make them case insensitive. It would be a different story if it were for developers only.

Copying files is hard enough for some server admins.

exvel 03-03-2010 11:52

Re: [INC] Colors (1.0.2)
 
I'll add a bool to determine if it must be case sensitive or not. =)


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

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