Changing spawns
#1

Hi,

Well I have some maps in a TDM with spawns. Well these spawns (of 2 teams) have to change each 6 minuts. But the teams still have to challenge eachother. So no SetTimer.. Cus thats per person different. The spawns have to change each 6 minuts and the server controlls that... So even when noone is only, the spawns changes.

Can someone give me a script for this? thanks!!!!!!!!
Reply
#2

As far as I understood

- The spawn change each 6 minutes ( for all )
- The players wont be moved

Is that correct ?
Reply
#3

well the players should be moved... They should go to another spawn and that has to be saved in the server... With other words:the class selection has to be changed every 6 minuts. (2 classes). When you join the game, the class selection is also changed, so everybody will be in the same map and spawn at the same place as his/her team.
Reply
#4

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
As far as I understood

- The spawn change each 6 minutes ( for all )
- The players wont be moved

Is that correct ?
Seems it



You can use SetTimerEx

eg,

pawn Код:
#define ChangingTeam1 0
#define ChangingTeam2 1

enum SpawnInfo {Float:x, Float:y, Float:z}
new SpawnArray[SpawnInfo][] = {
 {123.123, 123.123, 123.123}, //I have no idea where this is
 {321.321, 321.321, 321.321}  //I have no idea where this is either
}

forward Spawn(playerid);
public Spawn(playerid)
{
     for(new i; i < GetMaxPlayers(); i++)
     {
          if(GetPlayerTeam(playerid) == ChangingTeam1)
          {
               new rand = random(sizeof(SpawnInfo));
               SetPlayerPos(playerid, SpawnInfo[rand][x], SpawnInfo[rand][y], SpawnInfo[rand][z]);
               SendClientMessage(playerid, [A COLOUR], "You were respawned elsewhere");
          }
          else if(GetPlayerTeam(playerid) == ChangingTeam2)
          {
               new rand = random(sizeof(SpawnInfo));
               SetPlayerPos(playerid, SpawnInfo[rand][x], SpawnInfo[rand][y], SpawnInfo[rand][z]);
          }
     }
}

//Then

public OnPlayerSpawn(playerid)
{
     SetTimerEx("Spawn", false, "i", playerid);
     return 1;
}
The 'Spawn' Timer could also be:

pawn Код:
forward Spawn(playerid);
public Spawn(playerid)
{
     for(new i; i < GetMaxPlayers(); i++)
     {
          if(GetPlayerTeam(playerid) == ChangingTeam1)
          {
               SpawnPlayer(playerid);
          }
          else if(GetPlayerTeam(playerid) == ChangingTeam2)
          {
               SpawnPlayer(playerid);
          }
     }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)