Quote:
Originally Posted by Bugsy
It does that when get_players() finds no players, resulting in a random( 0 ) call which will return a number outside the boundaries of your array, and is irrelevant for what you're doing.
Do this:
PHP Code:
if ( num > 0 )
Boss1 = players[ random( num ) ];
|
Thanks.
But could you please explain why does it sometimes gives 0? For example I had a situation where we had 4 CTS and it gave me the result 0 and nothing happened next.. (my code didnt work) How can I fix it?