Gameplay::getRandomIntInRange

From RAGE Multiplayer Wiki
Jump to navigation Jump to search

Another extremely useful native.

You can use it simply like:
if (GAMEPLAY::GET_RANDOM_INT_IN_RANGE(0, 2))

and the if-statement will count it as false only if the random int is 0. That means there is a one in three chance of it being false. Put a '!' in front and it means there is a one in three chance of it being true.

Syntax

mp.game.gameplay.getRandomIntInRange(startRange, endRange);

Required Arguments

  • startRange: int
  • endRange: int

Return value

  • int

Example

// todo

See also

Template:Gameplay s function c