Dynamic Array run time error
Dear scripters!
I have a problem with this array, because the server logged this error message: [AMXX] Run time error 10: native error (native "ArrayGetCell") I filled array with numbers. So 2 line here: Code:
new random_number = random_num(0,ArraySize( g_aArray )); |
Re: Dynamic Array run time error
Use "random" instead of "random_num".
"random_num" uses an inclusive maximum value, so your value goes out of bounds. |
Re: Dynamic Array run time error
Yes, random( 10 ) would give you a value from 0 to 9 so for array index purposes it's perfect. Use random() with ArraySize() inside of it.
|
All times are GMT -4. The time now is 19:51. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.