Team Teleportation - 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)
+--- Thread: Team Teleportation (
/showthread.php?tid=518071)
Team Teleportation -
TheSimpleGuy - 08.06.2014
pawn Код:
CMD:tpallmotherfuckers(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 3)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
for(new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && gTeam[i] == Motherfuckers)
{
new name1[MAX_PLAYER_NAME], string[256];
GetPlayerName(playerid, name1, sizeof(name1));
SetPlayerPos(i, x, y, z);
SetPlayerInterior(i, GetPlayerInterior(playerid));
SetPlayerVirtualWorld(i, GetPlayerVirtualWorld(playerid));
format(string, sizeof(string), "%s [%d] has teleported all Motherfuckers into him.", name1, playerid);
SendClientMessageToAll(0xFF0000FF, string);
return 1;
}
}
}
return 1;
}
Well,when I try to use that command,it doesn't set all on the pos.
Re: Team Teleportation -
]Rafaellos[ - 08.06.2014
Because you put return 1 in the loop, plus it would spam MAX_PLAYER times the message.
pawn Код:
CMD:tpallmotherfuckers(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 3)
{
new Float:x, Float:y, Float:z, name1[MAX_PLAYER_NAME], string[80];
GetPlayerName(playerid, name1, sizeof(name1));
format(string, sizeof(string), "%s [%d] has teleported all Motherfuckers into him.", name1, playerid);
SendClientMessageToAll(0xFF0000FF, string);
GetPlayerPos(playerid, x, y, z);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && gTeam[i] == Motherfuckers)
{
SetPlayerPos(i, x, y, z);
SetPlayerInterior(i, GetPlayerInterior(playerid));
SetPlayerVirtualWorld(i, GetPlayerVirtualWorld(playerid));
}
}
}
return 1;
}
Re: Team Teleportation -
TheSimpleGuy - 08.06.2014
Oh,yes. I didnt notice that lol. Thanks!