select player random
#7

The above method would be simple and will work but relying on random data to exit a iterative statement is a bad practice.You can remove random value from the iterator,assign it to a variable denoting president and again take the random value from iterator for vice president and add the value that was removed previously, back into the iterator.Also you can take the number of players in event using Iter_Count function.
PHP код:
if(Iter_Count(PlayersInEvent) > 2){
    new 
president Iter_Random(PlayersInEvent);  
    
Iter_Remove(PlayersInEvent,president);
    new 
vice_president Iter_Random(PlayersInEvent);
    
Iter_Add(PlayersInEvent,president);
}else{
    
Iter_Clear(PlayersInEvent);
    
//end event ...

Reply


Messages In This Thread
select player random - by SapMan - 16.09.2018, 01:23
Re: select player random - by SyS - 16.09.2018, 02:21
Re: select player random - by TheToretto - 20.09.2018, 22:35
Re: select player random - by KinderClans - 20.09.2018, 22:42
Re: select player random - by TheToretto - 20.09.2018, 22:47
Re: select player random - by KinderClans - 20.09.2018, 22:51
Re: select player random - by SyS - 22.09.2018, 03:41
Re: select player random - by SapMan - 22.09.2018, 15:41
Re: select player random - by SapMan - 25.09.2018, 04:31
Re: select player random - by SapMan - 25.09.2018, 19:42
Re: select player random - by Calisthenics - 25.09.2018, 20:01
Re: select player random - by SapMan - 25.09.2018, 20:21

Forum Jump:


Users browsing this thread: 2 Guest(s)