Raised This Month: $30 Target: $400
 7% 

[INC] Colors (1.0.5)


Post New Thread Reply   
 
Thread Tools Display Modes
Karotte
Member
Join Date: Feb 2014
Old 03-03-2014 , 22:35   Re: [INC] Colors (1.0.5)
Reply With Quote #391

okay, but how is it possible then, that only i am able to see the other colors, when only i have it on my computer?

"on the computer that is doing the compiling" i cant compile it from sourcemod/compiler.php?

computer= my computer? xD i got colors.inc and morecolors.inc on my desktop btw

i go to bed now, its 35 AM, gonna read your message later, Thanks anyways
Karotte is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 03-03-2014 , 22:38   Re: [INC] Colors (1.0.5)
Reply With Quote #392

Wow.


The server doesn't need the include file, as all the information on how to make colors GETS COMPILED INTO THE SMX. Once the SMX is created, the include is no longer needed for anything to function. All the "how do i colors" info that the plugin needs is IN THE PLUGIN.

Quote:
i cant compile it from sourcemod/compiler.php?
No.
__________________
ddhoward is offline
Karotte
Member
Join Date: Feb 2014
Old 03-04-2014 , 07:08   Re: [INC] Colors (1.0.5)
Reply With Quote #393

okay thanks, how can i compile it then without the sourcemod compiler?

EDIT: i downloaded sourcemo 1.5.2 on my computer, went to sourcemod/scripting, added anticamp.sp. In include i added morecolors.inc. Then windows+R - cmd in scripting spcomp.exe anticamp.sp

*see attachment*

this is my new compiled anticamp.sp

*see attachment*

at this point, after cmd says, its compiled, morecolors.inc should be included or? If yes, then i tried to go to translations folder and added {cyan} or {olive}. But now the FULL message ingame is {DEFAULT}. Without the changes, the original anticamp.sp, its teamcolor and green in the message.
Attached Thumbnails
Click image for larger version

Name:	Unbenannt.jpg
Views:	306
Size:	58.2 KB
ID:	131110  
Attached Files
File Type: sp Get Plugin or Get Source (anticamp.sp - 131 views - 14.9 KB)
File Type: txt anticamp.phrases.txt (265 Bytes, 126 views)

Last edited by Karotte; 03-04-2014 at 07:38.
Karotte is offline
Ellie
Senior Member
Join Date: Apr 2013
Old 03-14-2014 , 13:30   Re: [INC] Colors (1.0.5)
Reply With Quote #394

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

Last edited by Ellie; 03-14-2014 at 13:31.
Ellie is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 03-14-2014 , 16:03   Re: [INC] Colors (1.0.5)
Reply With Quote #395

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 16:54.
Powerlord is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 03-14-2014 , 17:07   Re: [INC] Colors (1.0.5)
Reply With Quote #396

If you really want it, though, I've included a version here which duplicates what SourceMod does with ShowActivity.

While I was at it, I fixed a bug in ReplyToCommand not setting the translation target correctly and also added ReplyToCommandEx.

None of these has actually been tested, though.

colors-tester.smx is a quick plugin to test the CShowActivity, CShowActivityEx, and CShowActivity2 responses. Note that {teamcolor} is set to the client argument's color since it's logging what they are doing.
Attached Files
File Type: inc colors.inc (25.4 KB, 142 views)
File Type: sp Get Plugin or Get Source (colors-tester.sp - 117 views - 2.7 KB)
File Type: smx colors-tester.smx (8.6 KB, 128 views)
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 03-14-2014 at 17:17.
Powerlord is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 03-15-2014 , 03:15   Re: [INC] Colors (1.0.5)
Reply With Quote #397

The copy from my previous post was missing some color tag stripping before printing to the server or the console in the ShowActivity things. Whoops.

Still not thoroughly tested.
Attached Files
File Type: inc colors.inc (25.7 KB, 132 views)
File Type: sp Get Plugin or Get Source (colors-tester.sp - 110 views - 2.7 KB)
File Type: smx colors-tester.smx (8.8 KB, 97 views)
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 03-15-2014 at 03:16.
Powerlord is offline
Ellie
Senior Member
Join Date: Apr 2013
Old 03-15-2014 , 05:04   Re: [INC] Colors (1.0.5)
Reply With Quote #398

Quote:
Originally Posted by Powerlord View Post
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.
Yeah I was thinking this is why it hadn't been done before. And yes I do want it


Quote:
Originally Posted by Powerlord View Post
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.
I had actually tested both includes with TF2 separately and then together just as a test, colors.inc always takes priority and morecolors.inc doesn't work. Well with Source 2009 games morecolors.inc is definitely the way to go, and all other games with colors.inc. I needed those stocks mainly for L4D2 since morecolors doesn't work with it. Who do we have to annoy, I mean ask, at Valve to have hex color codes added to L4D2 (the only actual source game released in 2009)?


Quote:
Originally Posted by Powerlord View Post
The copy from my previous post was missing some color tag stripping before printing to the server or the console in the ShowActivity things. Whoops.

Still not thoroughly tested.
Many thank yous. I will test it and get back to you. Although I think it would be a good idea to remove the links from the older version and just point to your post below it.

Last edited by Ellie; 03-15-2014 at 05:10.
Ellie is offline
Ellie
Senior Member
Join Date: Apr 2013
Old 03-26-2014 , 13:52   Re: [INC] Colors (1.0.5)
Reply With Quote #399

Quote:
Originally Posted by Powerlord View Post
The copy from my previous post was missing some color tag stripping before printing to the server or the console in the ShowActivity things. Whoops.

Still not thoroughly tested.

Ok been testing this with multiple plugins and it seems to have trouble with translations and ends up not printing anything. I used the slap.sp with playercommands from sourcemod as one of my tests and got this:

Code:
L 03/25/2014 - 11:29:56: [SM] Plugin encountered error 4: Invalid parameter or parameter type
L 03/25/2014 - 11:29:56: [SM] Native "VFormat" reported: Language phrase "%t" not found
L 03/25/2014 - 11:29:56: [SM] Displaying call stack trace for plugin "playercommands.smx":
L 03/25/2014 - 11:29:56: [SM]   [0]  Line 833, C:\Program Files\Steam\steamapps\common\Left 4 Dead 2\left4dead2\addons\sourcemod\scripting\include\colors.inc::CShowActivity2()
L 03/25/2014 - 11:29:56: [SM]   [1]  Line 113, playercommands/slay.sp::MenuHandler_Slay()
The printochats and replytocommands work fine, it's just the showactivity ones not working.

Last edited by Ellie; 03-26-2014 at 13:59.
Ellie is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 03-26-2014 , 17:06   Re: [INC] Colors (1.0.5)
Reply With Quote #400

Quote:
Originally Posted by Ellie View Post
Ok been testing this with multiple plugins and it seems to have trouble with translations and ends up not printing anything. I used the slap.sp with playercommands from sourcemod as one of my tests and got this:

Code:
L 03/25/2014 - 11:29:56: [SM] Plugin encountered error 4: Invalid parameter or parameter type
L 03/25/2014 - 11:29:56: [SM] Native "VFormat" reported: Language phrase "%t" not found
L 03/25/2014 - 11:29:56: [SM] Displaying call stack trace for plugin "playercommands.smx":
L 03/25/2014 - 11:29:56: [SM]   [0]  Line 833, C:\Program Files\Steam\steamapps\common\Left 4 Dead 2\left4dead2\addons\sourcemod\scripting\include\colors.inc::CShowActivity2()
L 03/25/2014 - 11:29:56: [SM]   [1]  Line 113, playercommands/slay.sp::MenuHandler_Slay()
The printochats and replytocommands work fine, it's just the showactivity ones not working.
Looks like I passed the wrong argument to VFormat in CShowActivity2 and CShowActivityEx. Try this.

Edit: Spotted more errors. Fixing really quickly.

Edit 2: Fixed all 4 VFormat calls each for both CShowActivity2 and CShowActivityEx.

NOTE: This version is compiled for Debugging, so it has a lot of extra debugging messages output. I'll probably compile a non-debug version sometime soon (April 1).
Attached Files
File Type: inc colors.inc (25.7 KB, 181 views)
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 04-01-2014 at 16:03.
Powerlord 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 08:19.


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