DMS_Exile/@ExileServer/addons/a3_dms/scripts/fn_SelectRandomVal.sqf
eraser1 e8eedfa538 More features, fixes, tweaks
* NEW CONFIG VALUES: ```DMS_MarkerPosRandomization```,
```DMS_MarkerPosRandomRadius```, and ```DMS_RandomMarkerBrush```
* With the above configs, you can randomize the marker positions in a
random position around the actual mission center.
* You can also "force" DMS_fnc_CreateMarker to randomize (or not
randomize) the marker position with optional boolean parameter of index
3.
* Changed the default (non-randomized) circle marker "brush". It should
be a solid circle.
* Created new functions ```DMS_fnc_SelectOffsetPos``` and
```DMS_fnc_SelectRandomVal```
* Adjusted a couple functions to use them.
* Fixed ```DMS_fnc_IsNearWater```.
2015-09-10 17:48:56 -05:00

30 lines
430 B
Plaintext

/*
DMS_fnc_SelectRandomVal
Created by eraser1
Usage:
[
_min,
_max
] call DMS_fnc_SelectRandomVal;
Returns a random value between _min and _max.
*/
private ["_OK", "_min", "_max", "_return"];
_OK = params
[
["_min",0,[0]],
["_max",0,[0]]
];
if (!_OK) exitWith
{
diag_log format ["DMS ERROR :: Calling DMS_fnc_SelectRandomVal with invalid parameters: %1",_this];
};
_return = _min + random(_max - _min);
_return