Gametext types / Gametext style IDs in SAMP


ID's and types of gametexts in SA:MP with examples. Color constants and special symbols can be used with gametexts and textdraws. Click on any image to enlarge.


Color constants

Constant Description
~n~ New line
~r~ Red
~g~ Green
~b~ Blue
~w~ or ~s~ White
~y~ Yellow
~p~ Purple
~l~ Black (lower case L)
~h~ Turn text color lighter (used too much will make your text white, doesn't work on black)
if(strcmp(cmd, "/gtforme", true) == 0) {
    GameTextForPlayer(playerid, \
	"~r~Red text\
	~n~~y~Yellow Text\
	~n~~g~Green text\
	~n~~w~White text\
	~n~~p~Purple Text\
	~n~~l~Black text~n~~b~Blue text\
	~n~~b~~h~Less blue text", \
	2000, 5);
    return 1;
}

Special symbols

Constant Description
~u~ Up arrow
~s~ Down arrow
~<~ Left arrow
~>~ Right arrow
~]~ Displays a * symbol (only in text styles 3, 4 and 5)
~k~ Keyboard key mapping (e.g. ~k~~VEHICLE_TURRETLEFT~ and ~k~~PED_FIREWEAPON~)
Look here for a list of keys
if(strcmp(cmd, "/gtforme2", true) == 0) {
    GameTextForPlayer(playerid, \
	"Up: ~u~ \
	~n~Down: ~d~ ~n~Left: ~<~ ~n~Right ~>~ \
	~n~ Press ~k~~PED_JUMPING~", \
	2000, 5); 
    return 1;
}

Gametext styles

Style In-game view Description
0 Appears for 9 seconds regardless of time setting. Hides textdraws and any other gametext on screen.
1 Fades out after 8 seconds, regardless of time set.
If you have a time setting longer than that, it will re-appear after fading out and repeat until the time ends.
2 Does not disappear until the player respawns.
3
4
5 Displays for 3 seconds, regardless of what time you set. Will refuse to be shown if it is 'spammed'.
6