Random Player from Team
#4

Quote:
Originally Posted by oMa37
Посмотреть сообщение
Didn't really understand what u want, But something like this?
PHP код:
stock RandomPlaya()
{
     new 
random Random(MAX_PLAYERS);
     if(
TEAM_HUMAN(random))
     {
           return 
random;
     }
     else
     {
           
RandomPlaya();
     }

and use it like this:

PHP код:
new randomplayer RandomPlaya();
SetPlayerArmour(randomplayer100); // this is example 
You should add some checks to see if there even is someone in that team, else it will be an infinite loop.
Furthermore why get a random number from range 1000 if the highest connected human ID is for example 5?
It can theoretically take a very long time until a valid number is found. Practically this may never happen but still it's possible.
Reply


Messages In This Thread
Random Player from Team - by XStreeter - 15.05.2016, 18:04
Re: Random Player from Team - by XStreeter - 15.05.2016, 18:31
Re: Random Player from Team - by oMa37 - 15.05.2016, 18:37
Re: Random Player from Team - by NaS - 15.05.2016, 18:49
Re: Random Player from Team - by Nin9r - 16.05.2016, 07:14
Re: Random Player from Team - by Vince - 16.05.2016, 10:28

Forum Jump:


Users browsing this thread: 1 Guest(s)