BIS fnc selectRandom: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " <h3 style="display:none">Notes</h3> <dl class="command_description"> <!-- Note Section BEGIN --> <!-- Note Section END --> </dl> " to "") |
Lou Montana (talk | contribs) m (Text replacement - " *\| *([Cc]omments|COMMENTS|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments \("local" or "global"\)|Multiplayer Effects \("local" or "global"\)|Multiplayer Execution \("server" o...) |
||
Line 1: | Line 1: | ||
{{Function | {{Function | ||
| arma2 | | arma2 | ||
|1.00 | |1.00 | ||
|gr1= Arrays |GROUP1 | |gr1= Arrays |GROUP1 | ||
Line 16: | Line 16: | ||
| Selects one of the arguments at random. | | Selects one of the arguments at random. | ||
{{Feature|arma3 | Use [[selectRandom]] instead.}} | {{Feature|arma3 | Use [[selectRandom]] instead.}} | ||
| var1 call [[BIS_fnc_selectRandom]] | | var1 call [[BIS_fnc_selectRandom]] | ||
|p1= var1: [[Array]] - array of values of which one will be selected at random | |p1= var1: [[Array]] - array of values of which one will be selected at random | ||
| [[Any Value]] - One of the values you passed, chosen at random<br><br> | | [[Any Value]] - One of the values you passed, chosen at random<br><br> | ||
|x1= <code>_bestShooter <nowiki>=</nowiki> [_rento, _ben, _trit] [[call]] BIS_fnc_selectRandom; {{cc|returns one of the variables}} | |x1= <code>_bestShooter <nowiki>=</nowiki> [_rento, _ben, _trit] [[call]] BIS_fnc_selectRandom; {{cc|returns one of the variables}} | ||
_bestSeries <nowiki>=</nowiki> [["halo1","halo2"],["ofp","arma2"]] [[call]] BIS_fnc_selectRandom; {{cc|returns one of the arrays}} | _bestSeries <nowiki>=</nowiki> [["halo1","halo2"],["ofp","arma2"]] [[call]] BIS_fnc_selectRandom; {{cc|returns one of the arrays}} | ||
</code> | </code> | ||
|[[selectRandom]] | |[[selectRandom]] | ||
| |MPBEHAVIOUR= | | |MPBEHAVIOUR= |
Revision as of 23:44, 17 January 2021
Description
Syntax
- Syntax:
- Selects one of the arguments at random.
- Parameters:
- var1: Array - array of values of which one will be selected at random
- Return Value:
- var1 call BIS_fnc_selectRandom
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:
- Any Value - One of the values you passed, chosen at random
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