Dev KhayZia AZ Posted February 1 Posted February 1 buildin_rand: range (0) is to small. No randomness possible .@mid = .Peco[rand(.size)]; setarray .Peco[0], 2811; .size = getarraysize(.Peco); Quote
0 Start_ Posted February 1 Posted February 1 You need at least 2 array to random. (1 will error like you post) 1 Quote
0 rokimoki Posted February 1 Posted February 1 Just tell what you want and we can try to help you. If .size is initialized after the rand, it will rand(0), try this instead: .@mid = .Peco[rand(getarraysize(.Peco))]; // else where in the code OnInit: // inside the script but at end setarray .Peco[0], 2811; end; If size is 1, rand(1) will give 0, which is first position, no error must be shown. Quote
Question
Dev KhayZia AZ
buildin_rand: range (0) is to small. No randomness possible
.@mid = .Peco[rand(.size)];
setarray .Peco[0], 2811;
.size = getarraysize(.Peco);
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.