Random person?
#1

im confused on making every round gm starts how would i make it choose a random person to go to TEAM_0 my define<< i made one but was buggy and picking same person at a time-.-
Reply
#2

bump
Reply
#3

I wasn't sure what you meant so I made two functions.

http://pastebin.com/6VW51AH3
Reply
#4

i mean like onplayerspawn if gives u a timer of 40 sec which i already have but i want it to choose a random player from TEAM_0 to become one of them vs the other team
Reply
#5

pawn Код:
new
    Players[MAX_PLAYERS],
    count;

for(new i; i<MAX_PLAYERS; i++)
{
  if(IsPlayerConnected(i))
  {
    if(GetPlayerTeam(i) == TEAM_0)
    {
      Players[count] = i;
      count++;
    }
  }
}
new rand = sizeof(Players);
//Players[rand] would be the random player
That will generate a random player off of TEAM_0.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)