09.10.2017, 02:28
Quote:
About that RandomPlayer function you can use this.
Code:
GetRandomPlayer() { new iPlayer = -1, iID = random(GetPlayerPoolSize()); for(new i = 0; i < GetPlayerPoolSize(); i++){ if(!IsPlayerConnected(i)) continue; if(iID == i){ iPlayer = i; } else { CallLocalFunction("GetRandomPlayer", ""); } } return iPlayer; } |
Code:
GetRandomPlayer(loop=3) { RandomCase: loop--; if(loop < 0)return -1; new iID = random(GetPlayerPoolSize()); if(IsPlayerConnected(iID))return iID; else goto RandomCase; }