The Lab
MISC native

GET_RANDOM_INT_IN_RANGE

returns int2 paramsbuild 1207

Returns a random integer from startRange up to, but not including, endRange.

Signature

C
int GET_RANDOM_INT_IN_RANGE(int startRange, int endRange); // 0xD53343AA4FB7DD28 b1207

Parameters

#NameType
1startRangeint
2endRangeint

Facts

Facts about GET_RANDOM_INT_IN_RANGE
Name
GET_RANDOM_INT_IN_RANGE
Hash
0xD53343AA4FB7DD28
Namespace
Returns
int
Game build
1207

Examples

Calls by hash work in every RedM runtime. Replace the placeholder arguments with your own values.

Lua
local result = Citizen.InvokeNative(0xD53343AA4FB7DD28, -- GET_RANDOM_INT_IN_RANGE
  0, -- int startRange
  0, -- int endRange
  Citizen.ResultAsInteger()
)
print(result)
JavaScript
const result = Citizen.invokeNative("0xD53343AA4FB7DD28", // GET_RANDOM_INT_IN_RANGE
  0, // int startRange
  0, // int endRange
  Citizen.resultAsInteger()
);
console.log(result)
C#
int result = Function.Call<int>((Hash)0xD53343AA4FB7DD28, // GET_RANDOM_INT_IN_RANGE
  0, // int startRange
  0 // int endRange
);
All MISC natives

Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.