if(strcmp(cmd,"/getallhere",true)==0)
{
new Float:plocx,Float:plocy,Float:plocz;
new plo;
plo = ReturnUser(tmp);
if(PlayerInfo[playerid][pAdmin] < 4) return DenyMessage(playerid, 4);
GetPlayerName(playerid, playrname, sizeof(playrname));
format(string, sizeof(string), "[INFO:] %s has just teleported everyone to his location.", playrname);
SendClientMessageToAll(COLOR_YELLOW, string);
new Float:x,Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
for(new i = 0; i <= MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
SetPlayerPos(plo,plocx,plocy+2, plocz);
}
return 1;
}
if(strcmp(cmd, "/gethere", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[USAGE:] /gethere [playerid]");
return 1;
}
new Float:plocx,Float:plocy,Float:plocz;
new plo;
plo = ReturnUser(tmp);
if (IsPlayerConnected(plo))
{
if(plo != INVALID_PLAYER_ID)
{
if (PlayerInfo[playerid][pAdmin] >= 1)
{
GetPlayerPos(playerid, plocx, plocy, plocz);
new interior = GetPlayerInterior(playerid);
new world = GetPlayerVirtualWorld(playerid);
if (GetPlayerState(playerid) == 2)
{
new tmpcar = GetPlayerVehicleID(plo);
SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
SetPlayerVirtualWorld(plo,world);
SetPlayerInterior(plo,interior);
}
else
{
SetPlayerPos(plo,plocx,plocy+2, plocz);
SetPlayerVirtualWorld(plo,world);
SetPlayerInterior(plo,interior);
}
format(string, sizeof(string), "[INFO:] You teleported %s to you.", GetPlayerNameEx(plo));
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, string);
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] Your not an administrator.");
}
}
}
else
{
format(string, sizeof(string), " %d is not an active player.", plo);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}}
COMMAND:getallhere(playerid, params[])
{
if(File[playerid][Administrator] >= 4)
{
for(new i = 0; i <= MAX_PLAYERS; i++)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
SetPlayerPos(i, X, Y, Z);
}
}
}
if(strcmp(cmd, "/getallhere", true) == 0)
{
new Float:plocx,Float:plocy,Float:plocz;
if (PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] Your not an administrator.");
for(new plo; plo < MAX_PLAYERS; plo++)
{
if (IsPlayerConnected(plo) && plo != INVALID_PLAYER_ID)
{
GetPlayerPos(playerid, plocx, plocy, plocz);
new interior = GetPlayerInterior(playerid);
new world = GetPlayerVirtualWorld(playerid);
if (GetPlayerState(playerid) == 2)
{
new tmpcar = GetPlayerVehicleID(plo);
SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
SetPlayerVirtualWorld(plo,world);
SetPlayerInterior(plo,interior);
}
else
{
SetPlayerPos(plo,plocx,plocy+2, plocz);
SetPlayerVirtualWorld(plo,world);
SetPlayerInterior(plo,interior);
}
}
}
format(string, sizeof(string), "[INFO:] %s has teleported everyone to him", GetPlayerNameEx(playerid));
SendClientMessageToAll( COLOR_LIGHTYELLOW2, string);
return 1;
}
pawn Код:
|