Raised This Month: $ Target: $400
 0% 

[INC] Colors (1.0.5)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 03-14-2014 , 15:03   Re: [INC] Colors (1.0.5)
Reply With Quote #16

Quote:
Originally Posted by Ellie View Post
Hey, I was debating whether using this include or more colors. More colors works great with TF2 which I tested, but it doesn't work for non-source 2009 games like L4D2 (which is unbelievable since L4D2 was released in 2009 and is a source game). However, it has some stocks maybe that can be added to colors.inc such as:

Code:
/** 
 * Shows admin activity with colors 
 *  
 * @param client        Client performing an action 
 * @param message        Message (formatting rules) 
 * @noreturn 
 */ 
stock CShowActivity(client, const String:message[], any:...) 

/** 
 * Shows admin activity with colors 
 *  
 * @param client        Client performing an action 
 * @param tag            Tag to prepend to the message (color tags supported) 
 * @param message        Message (formatting rules) 
 * @noreturn 
 */ 
stock CShowActivityEx(client, const String:tag[], const String:message[], any:...) 

/** 
 * Shows admin activity with colors 
 *  
 * @param client        Client performing an action 
 * @param tag            Tag to prepend to the message (color tags supported) 
 * @param message        Message (formatting rules) 
 * @noreturn 
 */ 
stock CShowActivity2(client, const String:tag[], const String:message[], any:...)
Can someone add those to colors.inc please
To get these working correctly requires a bit of effort. For example, just by looking at the code, I can tell you that translations don't work properly with morecolors.inc's CShowActivity functions simply because formatting is done before passing the message on to a function that sends messages to all players (this is why CPrintToChatAll manually loops through players one by one rather and does formatting there than just calling CPrintToChat for each player in colors.inc and morecolors.inc).

To do it properly is a bit of effort, because you have to essentially duplicate what SourceMod is doing for each of these functions. While not impossible, it's a bit of a pain, especially since only natives can pass ... parameters to other functions... because ShowActivity and ShowActivityEx are essentially the same function.

Sometimes I think Colors and MoreColors should just be plugins to deal with this sort of thing, but then you'd only be able to have one or the other loaded at a time.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 03-14-2014 at 15:54.
Powerlord is offline
 



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 23:00.


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