MiscClient

getRandomMwcIntInRange

GET_RANDOM_MWC_INT_IN_RANGE0xF2D49816A804D134

The GTA V native GET_RANDOM_MWC_INT_IN_RANGE of the MISC namespace, as LS:MP client scripts call it: the global function getRandomMwcIntInRange, in JavaScript and in Lua.

SignatureJavaScript
getRandomMwcIntInRange(startRange: number, endRange: number): number
SignatureLua
getRandomMwcIntInRange(startRange: integer, endRange: integer): integer

Usage

JavaScript
const result = getRandomMwcIntInRange(startRange, endRange);
Lua
local result = getRandomMwcIntInRange(startRange, endRange)

Parameters

ParameterTypeJavaScriptLua
startRangeintnumberinteger
endRangeintnumberinteger

Returns

int JavaScript number, Lua integer

Reference

Namespace
Misc MISC
In the game
int GET_RANDOM_MWC_INT_IN_RANGE(int startRange, int endRange)
Hash
0xF2D49816A804D134
Introduced
Game build 1734 legacy numbering
Formerly
_GET_RANDOM_INT_IN_RANGE_2

Open in the interactive natives reference