Text Formatting
GTA V uses special formatting codes in text strings for colours, input prompts, and text styling. These work in notifications, help text, and other UI elements. Reset styles after highlighted text, prefer input tokens over literal keys, and test the final string in every UI surface where it appears.
Quick Usage
-- Coloured notification
BeginTextCommandThefeedPost("STRING")
AddTextComponentSubstringPlayerName("~r~ALERT: ~s~Something happened!")
EndTextCommandThefeedPostTicker(false, false)
-- Show input prompt in help text
BeginTextCommandDisplayHelp("STRING")
AddTextComponentSubstringPlayerName("Press ~INPUT_CONTEXT~ to interact")
EndTextCommandDisplayHelp(0, false, true, -1)// JavaScript equivalent
BeginTextCommandThefeedPost("STRING");
AddTextComponentSubstringPlayerName("~r~ALERT: ~s~Something happened!");
EndTextCommandThefeedPostTicker(false, false);All Formatting Codes
| Code | Description | Example |
|---|---|---|
| ~r~ | Red text | ~r~This is red |
| ~b~ | Blue text | ~b~This is blue |
| ~g~ | Green text | ~g~This is green |
| ~y~ | Yellow text | ~y~This is yellow |
| ~p~ | Purple text | ~p~This is purple |
| ~o~ | Orange text | ~o~This is orange |
| ~c~ | Grey text | ~c~This is grey |
| ~m~ | Dark grey text | ~m~This is dark grey |
| ~u~ | Black text | ~u~This is black |
| ~n~ | New line | Line 1~n~Line 2 |
| ~s~ | Reset/default color | ~r~Red ~s~Default |
| ~w~ | White text | ~w~This is white |
| ~h~ | Bold/highlight | ~h~Bold text |
| ~italic~ | Italic text | ~italic~Italic text |
| ~t~ | Tab/indent | ~t~Indented text |
| ~nrt~ | New line + reset + tab | Text~nrt~New line |
| ~ws~ | Space | Word~ws~Word |
| ~wanted_star~ | Wanted star icon | ~wanted_star~ |
| ~tinv~ | Transparent text | ~tinv~Hidden |
| ~1~ | Reset #1 | Text~1~ |
| INPUT_CONTEXT | Input button prompt | Press ~INPUT_CONTEXT~ |
| INPUT_FRONTEND_ACCEPT | Accept button | ~INPUT_FRONTEND_ACCEPT~ |
| INPUT_VEH_EXIT | Exit vehicle button | ~INPUT_VEH_EXIT~ |
| INPUT_SPRINT | Sprint button | Hold ~INPUT_SPRINT~ |
| INPUT_JUMP | Jump button | Press ~INPUT_JUMP~ |
| INPUT_ATTACK | Attack button | Press ~INPUT_ATTACK~ |
| INPUT_AIM | Aim button | Hold ~INPUT_AIM~ |
| INPUT_DUCK | Duck button | Press ~INPUT_DUCK~ |
| INPUT_SELECT_WEAPON | Weapon wheel | Open ~INPUT_SELECT_WEAPON~ |
| INPUT_CELLPHONE_UP | Phone up | Press ~INPUT_CELLPHONE_UP~ |
| INPUT_ENTER | Enter vehicle | Press ~INPUT_ENTER~ |
| INPUT_VEH_ACCELERATE | Accelerate | Hold ~INPUT_VEH_ACCELERATE~ |
| INPUT_VEH_BRAKE | Brake | Hold ~INPUT_VEH_BRAKE~ |
| INPUT_VEH_HORN | Horn | Press ~INPUT_VEH_HORN~ |
| INPUT_VEH_HANDBRAKE | Handbrake | Press ~INPUT_VEH_HANDBRAKE~ |