Assigning multiple locations to AddPlayerClass?
#1

Is there a way to assign multiple spawn locations to an AddPlayerClass? I want to make multiple maps, so whenever 1 round ends, and the other rounds start, I want them to spawn on another location.
I've been thinking about making global variables, like so:

pawn Код:
new Map1;
new Map2;
And then, when Map1 is playing, set Map1 to 1 and Map2 to 0. Then whenever the timer stops, so the round ends, it sets Map1 to 0 and Map2 to 1.

Then Under OnGameModeInit:

pawn Код:
if(Map1 == 1)
{
AddPlayerClass(/* the rest here */)
}
else if(Map2 == 1)
{
AddPlayerClass(/* the rest here */)
}
Will this work or not? And if not, is there any other way to do it?
Reply
#2

If you want random spawns use SetPlayerPos on OnPlayerSpawn, if you want random spawns for one character use RandomSpawn
Reply
#3

Oh, I think I know what you mean. So, will this work?

Under OnPlayerSpawn:

pawn Код:
if(Map1 == 1)
{
SetPlayerPos(...)
}
else if(Map2 == 1)
{
SetPlayerPos(...)
}
Reply
#4

Yes that way.
Reply
#5

Sorry ******...
Got it worked now. Thanks!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)