Jump to content

Recommended Posts

On 01/06/2016 at 9:19 AM, axeman said:

You are calling (execVM) the sqf before declaring _file, try:


private ["_file"]; 
_file = [250, 500, 750, 1000, 1250, 1500, 1750, 2000, 2500]; 
0 = [] execVM format ["overwrites\click_actions\%1.sqf",selectRandom _file]; 

If you want to reduce it further:


0 = [] execVM format ["overwrites\click_actions\%1.sqf",selectRandom [250, 500, 750, 1000, 1250, 1500, 1750, 2000, 2500]]; 

https://community.bistudio.com/wiki/selectRandom

This is for Arma 2, Axeman, he'll have to use the random like in the first example I posted.

Kiwi you did it again, lol

_file = ([250, 500, 750, 1000, 1250, 1500, 1750, 2000, 2500]);

Should be

_file = [250, 500, 750, 1000, 1250, 1500, 1750, 2000, 2500];

 

Link to comment
Share on other sites

//A2 compatible
_file = [250, 500, 750, 1000, 1250, 1500, 1750, 2000, 2500];
_rand = _file select (floor (random (count _file)));
execVM format ["overwrites\click_actions\%1.sqf",_rand];

// or a one-liner for lols
execVM format ["overwrites\click_actions\%1.sqf", [250, 500, 750, 1000, 1250, 1500, 1750, 2000, 2500] select (floor (random (count _file)))];

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...