Raised This Month: $32 Target: $400
 8% 

[INC] Colors (1.0.5)


Post New Thread Reply   
 
Thread Tools Display Modes
kiwi87
Member
Join Date: Sep 2009
Old 02-15-2010 , 05:25   Re: [INC] Colors (1.0.2)
Reply With Quote #111

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
kiwi87 is offline
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 02-15-2010 , 05:53   Re: [INC] Colors (1.0.2)
Reply With Quote #112

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); 
__________________
For admins: My plugins

For developers: Colors library
exvel is offline
Send a message via ICQ to exvel
kiwi87
Member
Join Date: Sep 2009
Old 02-15-2010 , 08:14   Re: [INC] Colors (1.0.2)
Reply With Quote #113

Quote:
Originally Posted by exvel View Post
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!
kiwi87 is offline
kiwi87
Member
Join Date: Sep 2009
Old 02-15-2010 , 08:57   Re: [INC] Colors (1.0.2)
Reply With Quote #114

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);
}
kiwi87 is offline
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 02-15-2010 , 11:58   Re: [INC] Colors (1.0.2)
Reply With Quote #115

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.
__________________
For admins: My plugins

For developers: Colors library

Last edited by exvel; 02-15-2010 at 12:02.
exvel is offline
Send a message via ICQ to exvel
kexz
Member
Join Date: May 2004
Old 03-01-2010 , 14:15   Re: [INC] Colors (1.0.2)
Reply With Quote #116

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...
kexz is offline
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 03-01-2010 , 14:30   Re: [INC] Colors (1.0.2)
Reply With Quote #117

Easy fix exvel;

Code:
native ReplaceString(String:text[], maxlength, const String:search[], const String:replace[], bool:caseSensitive=true);
__________________
Greyscale is offline
psychonic

BAFFLED
Join Date: May 2008
Old 03-01-2010 , 14:32   Re: [INC] Colors (1.0.2)
Reply With Quote #118

Quote:
Originally Posted by kexz View Post
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.
psychonic is offline
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 03-01-2010 , 15:23   Re: [INC] Colors (1.0.2)
Reply With Quote #119

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.
__________________
Greyscale is offline
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 03-03-2010 , 11:52   Re: [INC] Colors (1.0.2)
Reply With Quote #120

I'll add a bool to determine if it must be case sensitive or not. =)
__________________
For admins: My plugins

For developers: Colors library
exvel is offline
Send a message via ICQ to exvel
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 21:06.


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