05.11.2009, 22:52
Hi People,
I really need to find a way to teleport the whole team to a location...
Please help.
Thanks!
I really need to find a way to teleport the whole team to a location...
Please help.
Thanks!
//-------------------------[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;
}
Originally Posted by Redgie
pawn Код:
|
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 ? |
Originally Posted by Redgie
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;
}
//-------------------------[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;
}