Timer + Next Map?
#1

I am having trouble.I am donna make another zombie map I only have 1 so far.Anyway,I was wondering for the next map how do I do a timer once it ends.The next map shows up and it do that 1?
Reply
#2

You could use the SetTimer function at OnGameModeInit() and when the timer ends, set player's position to some other place(I haven't done derby before).

Example:
pawn Code:
public OnGameModeInit()
{
 SetTimer("MapChange",900000,false); //We've set a 15 minute timer.
 return 1;
}

forward MapChange();

public MapChange() //After 15 mins.
{
 for(new i; i< MAX_PLAYERS; i++) //Looping through players.
 {
  if(IsPlayerConnected(i)) //After looping, we're choosing connected players.
  {
   SetPlayerPos(i,yourposX,yourposY,yourposZ); //Setting all the connected player's position. You've to set the pos.
  }
 }
 return 1;
}
//Just an example.
.
Reply
#3

Thanks also for this

for(new i; i< MAX_PLAYERS; i++) //Looping through players.
{
if(IsPlayerConnected(i)) //After looping, we're choosing connected players. - for this they will select 2 teams for them right because its humans and zombies?
{
SetPlayerPos(i,yourposX,yourposY,yourposZ); //Setting all the connected player's position. You've - for this I am donna do 2 positions 1 for humans and other for zombies

Also for yourposX. it is having an error undefinied symbol
Reply
#4

Quote:
Originally Posted by nicholas1
View Post
Thanks also for this

for(new i; i< MAX_PLAYERS; i++) //Looping through players.
{
if(IsPlayerConnected(i)) //After looping, we're choosing connected players. - for this they will select 2 teams for them right because its humans and zombies?
{
SetPlayerPos(i,yourposX,yourposY,yourposZ); //Setting all the connected player's position. You've - for this I am donna do 2 positions 1 for humans and other for zombies

Also for yourposX. it is having an error undefinied symbol
You havent define them also position is float thats why we define them us float,.....
pawn Code:
public MapChange() //After 15 mins.
{
    new Float:x,Float:y,Float:z
    for(new i; i< MAX_PLAYERS; i++) //Looping through players.
    {
        if(IsPlayerConnected(i)) //After looping, we're choosing connected players.
        {
            SetPlayerPos(i,x,y,z); //Setting all the connected player's position. You've to set the pos.
        }
    }
    return 1;
}
Reply
#5

Ok I have did it
forward MapChange();

public MapChange() //After 15 mins.
{
new Float,Float:y,Float:z
for(new i; i< MAX_PLAYERS; i++) //Looping through players.
{
if(IsPlayerConnected(i)) //After looping, we're choosing connected players.
{
SetPlayerPos(i,x,y,z); //Setting all the connected player's position. You've to set the pos.
}
}
return 1;
}

But, error 001: expected token: ";", but found "for"
Reply
#6

simply add ";" at the end of the line you defined the floats:
Code:
new Float:x,Float:y,Float:z;
Reply
#7

Thanks Also,how do I select the pos.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)