RedM Natives

GET_RANDOM_INT_IN_RANGE

Hash0xD53343AA4FB7DD28
Runtime nameGetRandomIntInRange
NamespaceMISC
SideClient
NameOfficial
Docs
Since build1207
GTA V hash0xD53343AA4FB7DD28

Signature

int GET_RANDOM_INT_IN_RANGE(int startRange, int endRange);

Parameters

NameTypeDescription
startRangeint—
endRangeint—

Returns int

Usage

Lua
local retval = GetRandomIntInRange(startRange, endRange)

-- always works, by hash
local retval = Citizen.InvokeNative(0xD53343AA4FB7DD28, startRange, endRange, Citizen.ResultAsInteger())
JavaScript and C#
JavaScript
const retval = GetRandomIntInRange(startRange, endRange);

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

Sources

alloc8or RDR3 NativeDB

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