Teleport Team
#1

Hi People,
I really need to find a way to teleport the whole team to a location...

Please help.
Thanks!
Reply
#2

pawn Код:
//-------------------------[Teleport Teams]---------------------------------------------
  if (strcmp(cmd, "/teamteleport", true) == 0)
  {
    for(new i = 0; i <= MAX_PLAYERS; i++)
    {
      if(IsPlayerConnected(i) && teamid[i] == 1)//Replace teamid[i] with your team variable and teamid with the team ID you wish to teleport
      {
        SetPlayerPos(i,1.1,1.1,1.1);//Change to the co-ordinates you want to teleport them to
      }
    }
    return 1;
  }
Reply
#3

Quote:
Originally Posted by Redgie
pawn Код:
//-------------------------[Teleport Teams]---------------------------------------------
  if (strcmp(cmd, "/teamteleport", true) == 0)
  {
    for(new i = 0; i <= MAX_PLAYERS; i++)
    {
      if(IsPlayerConnected(i) && teamid[i] == 1)//Replace teamid[i] with your team variable and teamid with the team ID you wish to teleport
      {
        SetPlayerPos(i,1.1,1.1,1.1);//Change to the co-ordinates you want to teleport them to
      }
    }
    return 1;
  }
SUPER!
Really thank you!

Just 1 a bit off-topic question;
I saw the teamid[playerid] (or in this case teamid[i]) before, but I always use GetPlayerTeam(playerid)...
What do I have to do so I can use ?
Reply
#4

Quote:
Originally Posted by Nameless303
Just 1 a bit off-topic question;
I saw the teamid[playerid] (or in this case teamid[i]) before, but I always use GetPlayerTeam(playerid)...
What do I have to do so I can use ?
Quote:
Originally Posted by Redgie
pawn Код:
//Replace teamid[i] with your team variable and teamid with the team ID you wish to teleport
Yes you should change teamid[i] to GetPlayerTeam(i) and you should change the teamid, also the number behind the equal or if you want to teleport your own team put there GetPlayerTeam(playerid)

Actually is GetPlayerTeam working in 0.3 ? Idk :S
Reply
#5

Oops sorry mate didn't realise you were using the SA:MP team system

pawn Код:
//-------------------------[Teleport Teams]---------------------------------------------
  if (strcmp(cmd, "/teamteleport", true) == 0)
  {
    for(new i = 0; i <= MAX_PLAYERS; i++)
    {
      if(IsPlayerConnected(i) && GetPlayerTeam[i] == teamid)//Replace teamid with the team ID you wish to teleport
      {
        SetPlayerPos(i,1.1,1.1,1.1);//Change to the co-ordinates you want to teleport them to
      }
    }
    return 1;
  }
Or if you want the teleport to teleport eveyone in the same team as the person using the command:
pawn Код:
//-------------------------[Teleport Teams]---------------------------------------------
  if (strcmp(cmd, "/teamteleport", true) == 0)
  {
    new teamid = GetPlayerTeam(playerid);
    for(new i = 0; i <= MAX_PLAYERS; i++)
    {
      if(IsPlayerConnected(i) && GetPlayerTeam[i] == teamid)//Checks for players in the same team as playerid's team
      {
        SetPlayerPos(i,1.1,1.1,1.1);//Change to the co-ordinates you want to teleport them to
      }
    }
    return 1;
  }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)