Update compiles - 2 more files to do

fn_selfActions.sqf
player_updateGui.sqf
This commit is contained in:
icomrade
2016-02-29 00:26:12 -05:00
parent a83909b918
commit b96cd2d971
67 changed files with 3886 additions and 1212 deletions

View File

@@ -0,0 +1,23 @@
scriptName "Functions\arrays\fn_selectRandom.sqf";
/************************************************************
Random Select
By Andrew Barron
Parameters: array
This returns a randomly selected element from the passed array.
Example: [1,2,3] call BIS_fnc_selectRandom
Returns: 1, 2, or 3
************************************************************/
private["_ret"];
_ret = nil;
if(count _this > 0) then
{
_ret = (count _this) - 1; //number of elements in the array
//_ret = [0, _ret] call BIS_fnc_randomInt; //choose random index
_ret = random _ret;
_ret = _this select _ret; //get the element, return it
};
_ret