Raised This Month: $12 Target: $400
 3% 

[INC] ColorStatus


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DarkGL
Senior Member
Join Date: Aug 2010
Location: Warsaw, Poland
Old 09-26-2011 , 19:08   [INC] ColorStatus
Reply With Quote #1

Description
With that inc you can send StatusText in 4 colors
  • Yellow
  • Red
  • Blue
  • Grey

But there are some limits
  • In message you can use only one color i.e. one color for all text
  • Maximum 196 chars
  • If player have console open when plugin send colored message he will see wrong color

Usage
First you must add initColorStatus() to your plugin_init
for example
Code:
public plugin_init() {
                register_plugin(PLUGIN, VERSION, AUTHOR)
                initColorStatus();
}
without that colorstatus won't work

Code:
makeStatusText(id,COLOR_STATUS:color,Float:fTime = 0.0,const szText[] = "",any:...)
  • id - player id which display colored text if id = 0 message will be send to all
  • color - message color
    • RED_STATUS - red color
    • BLUE_STATUS - blue color
    • YELLOW_STATUS - yellow color
    • GREY_STATUS - grey color
  • fTime - display time if fTime = 0.0 text will by on hud to override
  • szText - text to display you can formate text like in client_print

Example Code
statustext_test.sma in Attached Files

Code:
makeStatusText(id,GREY_STATUS,0.0,"Szary statustext");
grey text to one player forever

Code:
makeStatusText(0,RED_STATUS,0.0,"Czerwony statustext");
red text to all players forever

Code:
makeStatusText(0,BLUE_STATUS,5.0,"Niebieski statustext");
blue text to all players displayed for 5 seconds

Code:
makeStatusText(id,YELLOW_STATUS,5.0,"formatowany %d %s",1,"string");
formated message
yellow text to one player displayed for 5 seconds "formatowany 1 string"
Attached Thumbnails
Click image for larger version

Name:	zolty.jpg
Views:	5037
Size:	21.5 KB
ID:	93114   Click image for larger version

Name:	czerwony.jpg
Views:	5062
Size:	22.6 KB
ID:	93115   Click image for larger version

Name:	niebieski.jpg
Views:	5018
Size:	30.3 KB
ID:	93116   Click image for larger version

Name:	szary.jpg
Views:	5154
Size:	27.9 KB
ID:	93117  
Attached Files
File Type: sma Get Plugin or Get Source (statustext_test.sma - 1730 views - 1.0 KB)
File Type: inc colorstatus.inc (5.9 KB, 1326 views)

Last edited by DarkGL; 09-27-2011 at 00:15.
DarkGL is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 09-26-2011 , 23:19   Re: [INC] ColorStatus
Reply With Quote #2

Good job.
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-27-2011 , 01:42   Re: [INC] ColorStatus
Reply With Quote #3

If i remember well, this method with tasks doesn't work very well, i used to make something like that.
I hope yours is better.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
dark_style
Senior Member
Join Date: Jul 2009
Location: Bulgaria
Old 09-27-2011 , 05:01   Re: [INC] ColorStatus
Reply With Quote #4

Good job. I will use it when I need it.
dark_style is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-27-2011 , 11:14   Re: [INC] ColorStatus
Reply With Quote #5

You could implement a position changing hud_centerid.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 09-27-2011 , 13:10   Re: [INC] ColorStatus
Reply With Quote #6

Good job.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Fedde
BANNED
Join Date: Sep 2011
Old 09-27-2011 , 22:06   Re: [INC] ColorStatus
Reply With Quote #7

Good Job!
Fedde is offline
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 09-28-2011 , 06:32   Re: [INC] ColorStatus
Reply With Quote #8

This is pretty interesting. So you're using the ability to change all of the text chat colors, to simply change one line of text? Love it. I would definitely use this over color chat considering sometimes all I want to do is print a simple colored text line.
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 09-28-2011 , 16:09   Re: [INC] ColorStatus
Reply With Quote #9

Quote:
Originally Posted by GXLZPGX View Post
This is pretty interesting. So you're using the ability to change all of the text chat colors, to simply change one line of text? Love it. I would definitely use this over color chat considering sometimes all I want to do is print a simple colored text line.
.......
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 09-28-2011 , 18:54   Re: [INC] ColorStatus
Reply With Quote #10

Quote:
Originally Posted by GXLZPGX View Post
This is pretty interesting. So you're using the ability to change all of the text chat colors, to simply change one line of text? Love it. I would definitely use this over color chat considering sometimes all I want to do is print a simple colored text line.
StatusText, not SayText.

Like the display used in War3ft, where the XP amount is displayed constantly, level, race, etc...
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
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 00:43.


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