Difference between revisions of "0098"

From GTAMods Wiki
Jump to navigation Jump to search
(Created page with "{{OpCode | games = {{Icon|t}} | command = GENERATE_RANDOM_FLOAT | description = Gets a random float between 0.0 and 1.0 and stores the result into a variable. | synt...")
 
m
 
(2 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
| command    = GENERATE_RANDOM_FLOAT
 
| command    = GENERATE_RANDOM_FLOAT
 
| description = Gets a random float between 0.0 and 1.0 and stores the result into a variable.
 
| description = Gets a random float between 0.0 and 1.0 and stores the result into a variable.
| syntax1    = 0098: [''var1''] = random_float_in_ranges_0.0_to_1.0
+
| syntax1    = 0098: generate_random_float [''var'']
| p1t        = [''var1'']
+
| p1t        = [''var'']
 
| p1d        = Variable to store random float value
 
| p1d        = Variable to store random float value
 
}}
 
}}
  
This opcode only returns a fixed range of "0.0" and "1.0". To return a custom range, use [[0208]] instead.
+
This opcode gets a random float between 0.0 and 1.0 and stores the result into a variable. It only returns a fixed range of "0.0" and "1.0". To return a custom range, use [[0208]] instead.
  
 
== Keywords ==
 
== Keywords ==
 
random, rand, random number, random value
 
random, rand, random number, random value

Latest revision as of 12:04, 2 August 2017

GTA III Vice City San Andreas GENERATE_RANDOM_FLOAT


Description
Gets a random float between 0.0 and 1.0 and stores the result into a variable.
Syntax
0098: generate_random_float [var]
Parameter
[var]
Variable to store random float value

This opcode gets a random float between 0.0 and 1.0 and stores the result into a variable. It only returns a fixed range of "0.0" and "1.0". To return a custom range, use 0208 instead.

Keywords

random, rand, random number, random value