RedM Natives

GET_LENGTH_OF_LITERAL_STRING_IN_BYTES

Hash0xDC5AD6B7AB8184F5
Runtime nameGetLengthOfLiteralStringInBytes
NamespaceHUD
SideClient
NameOfficial
Docs
Since build1207
GTA V hash0x43E4111189E54F0E

Signature

int GET_LENGTH_OF_LITERAL_STRING_IN_BYTES(const char* string);

Parameters

NameTypeDescription
stringconst char*—

Returns int

Usage

Lua
local retval = GetLengthOfLiteralStringInBytes(string)

-- always works, by hash
local retval = Citizen.InvokeNative(0xDC5AD6B7AB8184F5, string, Citizen.ResultAsInteger())
JavaScript and C#
JavaScript
const retval = GetLengthOfLiteralStringInBytes(string);

// by hash
const retval = Citizen.invokeNative('0xDC5AD6B7AB8184F5', string, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
C#
int retval = Function.Call<int>((Hash)0xDC5AD6B7AB8184F5, string);

Sources

alloc8or RDR3 NativeDB

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.