Quote:
Originally Posted by Cv3
PHP Code:
random_num(0,TOTALROWS - 1)
|
If you are using it to select a random index for an array, you should use random(sizeof(my_array)).
Quote:
Originally Posted by Cv3
the problem occurs, I have 5 servers selecting from the same file. And they are not supposed to "random" select the same thing.
|
What you describe here is NOT purely random.
Quote:
Originally Posted by Cv3
At all this random_num thing is not that random .. how can I randomize it completely ?
|
You just said that you didn't want a random selection because you don't want your other servers to get the same number. This is how random works. There is a chance that you will get the same number every single time that the function is used.
random() and random_num() is the most random you can get with AMX Mod X. Other computer-based random functions won't be much, if any, better than these. If you want truly random, start flipping coins (but you don't want random because you stated that in your post).
In conclusion, if you want help, you will need to describe better your situation and what you
really want (not what you think you need to get what you want; aka "The XY Problem").
EDIT: This might be helpful:
[HOW TO] Retrieve random values from an array without retreiving the same twice
__________________