HUDClient

getFirstNCharactersOfLiteralString

GET_FIRST_N_CHARACTERS_OF_LITERAL_STRING0x98C3CF913D895111

The GTA V native GET_FIRST_N_CHARACTERS_OF_LITERAL_STRING of the HUD namespace, as LS:MP client scripts call it: the global function getFirstNCharactersOfLiteralString, in JavaScript and in Lua.

SignatureJavaScript
getFirstNCharactersOfLiteralString(string: string, length: number): string
SignatureLua
getFirstNCharactersOfLiteralString(string: string, length: integer): string

Usage

JavaScript
const text = getFirstNCharactersOfLiteralString(string, length);
Lua
local text = getFirstNCharactersOfLiteralString(string, length)

Parameters

ParameterTypeJavaScriptLua
stringstringstringstring
lengthintnumberinteger

Returns

string JavaScript string, Lua string

Reference

Namespace
HUD HUD
In the game
const char* GET_FIRST_N_CHARACTERS_OF_LITERAL_STRING(const char* string, int length)
Hash
0x98C3CF913D895111
Introduced
Game build 505 legacy numbering

Open in the interactive natives reference