BIS fnc selectRandom: Difference between revisions
Jump to navigation
Jump to search
m (Text replacement - "\[\[[cC]ategory:[fF]unctions\|\{\{uc:[a-z A-Z_]*\}\}\]\]" to "") |
Lou Montana (talk | contribs) m (Text replacement - "(\|[pr][0-9]+ *= *[^- ]*) *- *O([a-z ])" to "$1 - o$2") |
||
(13 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{RV|type=function | {{RV|type=function | ||
| arma2 | |game1= arma2 | ||
|version1= 1.00 | |||
|1. | |game2= arma2oa | ||
|version2= 1.50 | |||
| | |game3= tkoh | ||
|version3= 1.00 | |||
| | |game4= arma3 | ||
|version4= 0.50 | |||
| | |gr1= Arrays | ||
|eff= local | |||
| Selects one of the arguments at random. | |descr= Selects one of the arguments at random. | ||
{{Feature|arma3 | Use [[selectRandom]] instead.}} | {{Feature|arma3|Use [[selectRandom]] instead.}} | ||
| | |s1= values call [[BIS_fnc_selectRandom]] | ||
|p1= | |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= < | |x1= <sqf>private _bestShooter = [_rento, _ben, _trit] call BIS_fnc_selectRandom; // returns one of the variables | ||
_bestSeries | _bestSeries = [["halo1","halo2"],["ofp","arma2"]] call BIS_fnc_selectRandom; // returns one of the arrays | ||
</ | </sqf> | ||
|[[selectRandom]] | |seealso= [[selectRandom]] | ||
}} | }} | ||
Latest revision as of 15:44, 8 November 2023
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:
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