[HELP] Random ID
#6

PHP код:
GetRandomPlayerInTeam(teamid) {
    new
        
count,
        
player[MAX_PLAYERS],
        
GetPlayerPoolSize()
    ;
    while(
>= 0) { // set gTeam to an invalid value in OnPlayerDisconnect to
        
if(gTeam[i] == teamid) { // avoid the additional call to IsPlayerConnected
            
player[count++] = i;
        }
        
i--;
    }
    return 
count player[random(count)] : INVALID_PLAYER_ID;

Reply


Messages In This Thread
[HELP] Random ID - by MRM - 24.03.2016, 12:01
Re: [HELP] Random ID - by Golden96 - 24.03.2016, 13:04
Re: [HELP] Random ID - by MRM - 24.03.2016, 13:10
Re: [HELP] Random ID - by Golden96 - 24.03.2016, 13:21
Re: [HELP] Random ID - by MRM - 24.03.2016, 13:51
Re: [HELP] Random ID - by Nero_3D - 24.03.2016, 16:20
Re: [HELP] Random ID - by SickAttack - 24.03.2016, 16:33
Re: [HELP] Random ID - by MRM - 24.03.2016, 16:52
Re: [HELP] Random ID - by Vince - 24.03.2016, 17:18
Re: [HELP] Random ID - by MRM - 24.03.2016, 19:47

Forum Jump:


Users browsing this thread: 3 Guest(s)