BIS fnc selectRandom: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Some wiki formatting) |
Lou Montana (talk | contribs) m (Text replacement - "code>_([a-zA-Z0-9_]+) = " to "code>private _$1 = ") |
||
Line 26: | Line 26: | ||
|r1= [[Anything]] - One of the values you passed, chosen at random<br><br> | |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}} | |x1= <code>[[private]] _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}} | _bestSeries = [["halo1","halo2"],["ofp","arma2"]] [[call]] [[BIS_fnc_selectRandom]]; {{cc|returns one of the arrays}} | ||
</code> | </code> |
Revision as of 12:06, 6 May 2022
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:
private _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