what's the ...
#1

what's the command to choose a random player ?
Reply
#2

There's no command to "choose a random player", you have to make it yourself.
Reply
#3

I know I meant to say what's the variable/param (I forgot the name)
Reply
#4

Do you mean Random(); ?
Reply
#5

yeah, but is there something like RandomPlayer or something ? (my pawno doesn't show those things I dunno why)
Reply
#6

pawn Код:
stock GetRandomPlayer()
{
    new
        playerid,
        max_players = GetMaxPlayers;

    do {playerid = random(max_players);}
    while(!IsPlayerConnected(playerid));
    return playerid;
}
Reply
#7

Thanks, can you also help me make a command like (/bance) and then it gets a random player and put it on this team:

Код:
	if(team[playerid] == 2) //Zombies
	{
		SetPlayerColor(playerid,ZRED);
		SetPlayerTeam(playerid, 2);
		SetPlayerHealth(playerid, 200);
		GameTextForPlayer(playerid,"~r~Zombie: ~b~/hide",10000,1);
	}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)