samp.directory
← Tools

Colours and text preview

Get a colour in every form a script needs, and see chat lines, dialogs and game text before trying them in the game.

Colour

Most functions: SendClientMessage, TextDrawColor, SetPlayerColor
0x33AA33FF
Inside chat and dialog text
{33AA33}
Object material text: SetObjectMaterialText
0xFF33AA33
As a number, the way printf shows it
866792447

Chat and dialog text

Write {RRGGBB} to change colour and \n for a new line. Text before any code uses the colour picked above in chat, and the dialog’s own pale blue in dialogs.

Longest line: 59 of 144 characters.

Welcome to the server, Player_Name!
Type /help to get started.
Title
Welcome to the server, Player_Name!
Type /help to get started.
OK
Lists, input boxes and tables: open the dialog builder →
SendClientMessage(playerid, 0x33AA33FF, "{FFFFFF}Welcome to the server, {33AA33}Player_Name{FFFFFF}!");
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Title", "{FFFFFF}Welcome to the server, {33AA33}Player_Name{FFFFFF}!\nType {FFFF00}/help{FFFFFF} to get started.", "OK", "");

Game text

GameTextForPlayer uses codes between tildes: ~r~ ~g~ ~b~ ~y~ ~p~ ~w~ ~l~ for colours, ~h~ to lighten, ~n~ for a new line, and ~k~~VEHICLE_ENTER_EXIT~ for the player’s key for an action.

Drawn as the game draws this style on a 1920 × 1080 screen: in its own lettering, colour, outline and place.

The codes are balanced.

GameTextForPlayer(playerid, "~g~Mission passed!~n~~w~Respect +", 3000, 3);

How SA-MP colours and text codes work

  • Most functions take a colour as 0xRRGGBBAA: red, green, blue, then alpha, where FF is solid. In chat the alpha is ignored.
  • Inside a message or dialog, {RRGGBB} changes the colour for the text after it. Each code uses 8 of the 144 characters a chat line can hold.
  • Object material text uses 0xAARRGGBB, with alpha first. Mixing the two orders up is the usual reason a colour comes out wrong.
  • Game text has its own codes between tildes. Every ~ must have a partner: one stray tilde crashes the players who see it.
SA-MP colour picker, chat colour and GameText preview | samp.directory