[INC] ColorStatus

For scripting examples for learning how to use AMXX.
User avatar
Archive-Poster
Posts: 1090
Gender:
United States of America

[INC] ColorStatus

Post by Archive-Poster »

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: Select all

public plugin_init() {
                register_plugin(PLUGIN, VERSION, AUTHOR)
                initColorStatus();
}
without that colorstatus won't work

Code: Select all

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: Select all

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

Code: Select all

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

Code: Select all

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

Code: Select all

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"
Attachments
ColorStatus_01.jpg
ColorStatus_01.jpg (21.55 KiB) Viewed 22 times
ColorStatus_02.jpg
ColorStatus_02.jpg (22.57 KiB) Viewed 22 times
ColorStatus_03.jpg
ColorStatus_03.jpg (30.26 KiB) Viewed 22 times
ColorStatus_04.jpg
ColorStatus_04.jpg (27.86 KiB) Viewed 22 times
statustext_test.sma.zip
(656 Bytes) Downloaded 3 times
colorstatus.inc.zip
(1.68 KiB) Downloaded 4 times

Who is online

Users browsing this forum: No registered users and 1 guest