BIS fnc selectRandom: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " \| arma2 \| *([0-9]\.[0-9]{2}) * " to " | arma2 |$1 |game2= arma2oa |version2= 1.50 |game3= tkoh |version3= 1.00 |game4= arma3 |version4= 0.50 ") |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
Line 1: | Line 1: | ||
{{RV|type=function | {{RV|type=function | ||
| arma2 | |game1= arma2 | ||
|1.00 | |version1= 1.00 | ||
|game2= arma2oa | |game2= arma2oa | ||
Line 13: | Line 13: | ||
|version4= 0.50 | |version4= 0.50 | ||
|gr1= Arrays | |gr1= Arrays | ||
| | |eff= local | ||
| | |descr= Selects one of the arguments at random. | ||
{{Feature|arma3|Use [[selectRandom]] instead.}} | |||
| | |s1= values call [[BIS_fnc_selectRandom]] | ||
| | |p1= values: [[Array]] - array of values of which one will be selected at random | ||
| | |r1= [[Anything]] - One of the values you passed, chosen at random<br><br> | ||
|x1= <code>_bestShooter = [_rento, _ben, _trit] [[call]] [[BIS_fnc_selectRandom]]; {{cc|returns one of the variables}} | |||
_bestSeries = [["halo1","halo2"],["ofp","arma2"]] [[call]] [[BIS_fnc_selectRandom]]; {{cc|returns one of the arrays}} | |||
|x1= <code>_bestShooter | |||
_bestSeries | |||
</code> | </code> | ||
|seealso= [[selectRandom]] | |seealso= [[selectRandom]] | ||
}} | }} | ||
Revision as of 13:20, 10 June 2021
Description
Syntax
- Syntax:
- values call BIS_fnc_selectRandom
- Parameters:
- values: Array - array of values of which one will be selected at random
- Return Value:
- Anything - One of the values you passed, chosen at random
Examples
- Example 1:
_bestShooter = [_rento, _ben, _trit] call BIS_fnc_selectRandom; // returns one of the variables _bestSeries = [["halo1","halo2"],["ofp","arma2"]] call BIS_fnc_selectRandom; // returns one of the arrays
Additional Information
- See also:
- selectRandom
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note