The Lab
MISC native

GET_RANDOM_FLOAT_IN_RANGE

returns float2 paramsbuild 1207

Returns a random float between startRange and endRange.

Signature

C
float GET_RANDOM_FLOAT_IN_RANGE(float startRange, float endRange); // 0xE29F927A961F8AAA b1207

Parameters

#NameType
1startRangefloat
2endRangefloat

Facts

Facts about GET_RANDOM_FLOAT_IN_RANGE
Name
GET_RANDOM_FLOAT_IN_RANGE
Hash
0xE29F927A961F8AAA
Namespace
Returns
float
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(0xE29F927A961F8AAA, -- GET_RANDOM_FLOAT_IN_RANGE
  0.0, -- float startRange
  0.0, -- float endRange
  Citizen.ResultAsFloat()
)
print(result)
JavaScript
// Whole JS numbers are sent as integers: pass floats like 1.5 (or n + 0.0000001), never 1.
const result = Citizen.invokeNative("0xE29F927A961F8AAA", // GET_RANDOM_FLOAT_IN_RANGE
  0.0, // float startRange
  0.0, // float endRange
  Citizen.resultAsFloat()
);
console.log(result)
C#
float result = Function.Call<float>((Hash)0xE29F927A961F8AAA, // GET_RANDOM_FLOAT_IN_RANGE
  0.0f, // float startRange
  0.0f // float endRange
);
All MISC natives

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