[SOLVED] Error: Index out of bounds (function get_players)
Hi, I'm having the following error:
Quote:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
Please tell me what's wrong with my code, when there is 1 CT the function logevent_round_start() doesn't run and when there are 2 CTs it chooses the CT with the first ID. Basically I need it to choose a random CT and set g_player_is_leader[ id of the chosen CT ] to true. |
Re: Error: Index out of bounds (function get_players)
1. Check if there are any players before doing that.
2. You use random incorrectly. random() goes from 0 to (x-1) where x is the value you pass. Therefore, either do random(iNum) or random_num(0, iNum-1) |
Re: Error: Index out of bounds (function get_players)
It's working now, thanks!
|
| All times are GMT -4. The time now is 14:39. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.