Spawning all players at once?
#1

I'm making a gamemode where it's basically a Attack n' Defend, and i want that if one player reaches a specific point and types a command (/capture), then it will spawn all players back, and send a GameTextForAll saying the round has ended, et cetera. So, i was wondering.. Is there a function that can spawn all players at once? (And that hopefully won't cause my server to go "Fuck this." and die.)

Thanks in advance,

Sky.
Reply
#2

Simply use a loop to go through all of your players and spawn them using SpawnPlayer(); like so:

pawn Код:
for(new i; i < MAX_PLAYERS; i++)
{
  if(IsPlayerConnected(i))
  {
    SpawnPlayer(i);
  }
}
GameTextForAll("Round has ended..",5000,3);
However I recommend using foreach instead of a loop, this is only an example
Reply
#3

Quote:
Originally Posted by JaTochNietDan
Simply use a loop to go through all of your players and spawn them using SpawnPlayer(); like so:

pawn Код:
for(new i; i < MAX_PLAYERS; i++)
{
  if(IsPlayerConnected(i))
  {
    SpawnPlayer(i);
  }
}
GameTextForAll("Round has ended..",5000,3);
However I recommend using foreach instead of a loop, this is only an example
Hmm, thanks mate! I'm going to try using the spawnplayer part right now, thanks again!

EDIT: Thanks, worked GREAT!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)