Commands, codes and IDs
SA-MP colour codes: how to use {FFFFFF} in chat and text
How {RRGGBB} colour codes work in SA-MP, a ready-made colour table, GameText codes such as ~r~ and the 0xRRGGBBAA format used in scripts.
Vice Roleplay · Sources checked:

In SA-MP you change text colour with a six-digit HEX code in curly brackets: {FF0000}red. The colour starts where you write the code and lasts until the next code. Many servers do not let players colour their own chat, so these codes are mostly used in server messages, dialogs and 3D text.
Ready-made colours
| Colour | HEX | Code to type |
|---|---|---|
| White | FFFFFF | {FFFFFF} |
| Black | 000000 | {000000} |
| Grey | AFAFAF | {AFAFAF} |
| Red | FF0000 | {FF0000} |
| Dark red | AA3333 | {AA3333} |
| Orange | FF9900 | {FF9900} |
| Yellow | FFFF00 | {FFFF00} |
| Gold | FFD700 | {FFD700} |
| Green | 00FF00 | {00FF00} |
| Dark green | 33AA33 | {33AA33} |
| Cyan | 00FFFF | {00FFFF} |
| Light blue | 33CCFF | {33CCFF} |
| Blue | 0000FF | {0000FF} |
| Purple | 9900FF | {9900FF} |
| Pink | FF66CC | {FF66CC} |
| Brown | 8B4513 | {8B4513} |
GameText codes
Big on-screen texts (GameText) and some textdraws use a different system: letters between tildes.
| Code | Meaning |
|---|---|
~r~ | Red |
~g~ | Green |
~b~ | Blue |
~y~ | Yellow |
~p~ | Purple |
~w~ | White |
~l~ | Black |
~h~ | Makes the colour lighter; can be stacked |
~n~ | New line |
For scripters: 0xRRGGBBAA
Functions such as SendClientMessage take colours as 0xRRGGBBAA; the last two digits are transparency (alpha). The names below are common defines in many gamemodes.
| Name | Value |
|---|---|
COLOR_WHITE | 0xFFFFFFAA |
COLOR_GREY | 0xAFAFAFAA |
COLOR_RED | 0xAA3333AA |
COLOR_GREEN | 0x33AA33AA |
COLOR_YELLOW | 0xFFFF00AA |
COLOR_LIGHTBLUE | 0x33CCFFAA |
COLOR_ORANGE | 0xFF9900AA |
If a colour does not show: the code must be exactly six digits, inside curly brackets and without #. If it still does not work, the server probably blocks colours in that place.
Sources and scope
This article was prepared with AI assistance after checking the sources and Vice rules. Example scenes were written for explanation and do not describe actual player incidents. Current server rules and on-screen requirements take precedence.