Teleport Team - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Teleport Team (
/showthread.php?tid=106825)
Teleport Team -
Nameless303 - 05.11.2009
Hi People,
I really need to find a way to teleport the whole team to a location...
Please help.
Thanks!
Re: Teleport Team -
Redgie - 05.11.2009
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;
}
Re: Teleport Team -
Nameless303 - 05.11.2009
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 ?
Re: Teleport Team -
Nero_3D - 05.11.2009
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
Re: Teleport Team -
Redgie - 06.11.2009
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;
}