Colori DrawText
Scrivi del testo con i codici di formattazione di GTA V (~r~, ~b~, ~h~, ~n~ …) e guarda l'anteprima in tempo reale di come viene reso in DrawText, nelle notifiche e nel testo di aiuto.
Per ora questo strumento e le sue note sono in inglese.
Text
DrawText options
Reward: $2500 (bonus)
Preview is close, not pixel exact: GTA fonts are replaced with system fonts.
AddTextEntry("FIVEMAD_TEXT", "~b~Mission~s~ started. Press ~INPUT_CONTEXT~ to talk to ~y~~a~~s~.~n~Reward: ~g~$~1~~s~ ~h~(bonus)~h~")
CreateThread(function()
while true do
Wait(0)
SetTextFont(4)
SetTextScale(0.0, 0.5)
SetTextColour(255, 255, 255, 255)
SetTextOutline()
SetTextCentre(true)
BeginTextCommandDisplayText("FIVEMAD_TEXT")
AddTextComponentSubstringPlayerName("Lamar")
AddTextComponentInteger(2500)
EndTextCommandDisplayText(0.5, 0.8)
end
end)Reference (click to insert)
FiveM chat colours
The default chat resource uses caret codes, not tildes. ^0 to ^9 set the colour, ^* bold, ^_ underline, ^~ strikethrough and ^r resets.
Message
-- client side
TriggerEvent("chat:addMessage", {
color = { 255, 255, 255 },
multiline = true,
args = { "Dispatch", "^1[Police]^0 Suspect spotted near ^3Legion Square^0. ^*All units^r respond." }
})
-- server side, to one player (use -1 for everyone)
TriggerClientEvent("chat:addMessage", source, {
args = { "Dispatch", "^1[Police]^0 Suspect spotted near ^3Legion Square^0. ^*All units^r respond." }
})How GTA text codes work
Any string that goes through a text command (DrawText, notifications, help text, subtitles, blip names) can carry inline codes wrapped in tildes. A colour code stays active until the next colour code, and~s~ goes back to the default colour (whatever you set with SetTextColour, or white for notifications and help text).
~r~ ~b~ ~g~ ~y~ ~p~ ~q~ ~o~ ~c~ ~m~ ~w~ ~l~: colours.~HUD_COLOUR_NAME~works too.~h~: bold on, then off again.~n~: new line.~INPUT_CONTEXT~and other control names render the button the player has bound, so prompts stay correct on custom keybinds and gamepad.~a~and~1~are placeholders filled byAddTextComponentSubstringPlayerNameandAddTextComponentInteger, in order. Register the string withAddTextEntryfirst.
Long strings
A single AddTextComponentSubstringPlayerName is cut at 99 characters. For longer text the snippet switches to the built-in CELL_EMAIL_BCON entry and splits your text into chunks, without breaking a code in half.
Notifications and help text
BeginTextCommandThefeedPost("STRING")
AddTextComponentSubstringPlayerName("~g~Saved~s~ your outfit.")
EndTextCommandThefeedPostTicker(false, true)
-- help text has to be drawn every frame
BeginTextCommandDisplayHelp("STRING")
AddTextComponentSubstringPlayerName("Press ~INPUT_CONTEXT~ to open the shop")
EndTextCommandDisplayHelp(0, false, true, -1)Chat codes
The FiveM chat resource does not understand tildes. It uses ^0 to ^9 for colours plus^*, ^_, ^~, ^= and ^r for formatting. The colours shown are the defaults from the stock chat stylesheet, a custom chat theme can change them.
Colour values for the tilde codes follow Vespura's text colour reference and the game's HUD colours.
Altri strumenti calcolatori
Calcolatore hash joaat
Converti qualsiasi stringa nel suo valore GetHashKey (joaat) in forma signed, unsigned ed esadecimale, all'istante.
Calcolatore driving style
Spunta i comportamenti che vuoi e ottieni il valore del flag driving style per TaskVehicleDriveToCoord e simili.
Calcolatore flag animazioni
Crea il valore del flag per TaskPlayAnim: loop, parte alta del corpo, controllabile, tieni l'ultimo frame e altro.
