[SHARE] Recall everyone in the server - Puxa todos do servidor para você!

Rafito

Heir
Code:

Java:
/package Anunciar;

import handler.admincommands.ScriptAdminCommand;
import l2.gameserver.handler.admincommands.IAdminCommandHandler;
import l2.gameserver.model.GameObjectsStorage;
import l2.gameserver.model.Player;
import l2.gameserver.scripts.ScriptFile;

public class RecallAll extends ScriptAdminCommand implements IAdminCommandHandler, ScriptFile
{

@Override
    public Enum<?>[] getAdminCommandEnum()
    {
return Commands.values();
    }

@Override
    public boolean useAdminCommand(@SuppressWarnings("rawtypes") Enum comm, String[] args, String fullString, Player player)
    {
final Commands command = (Commands) comm;
        if (!player.getPlayerAccess().CanViewChar)
return false;

        switch (command)
        {
case admin_recall_all:
            {
Recall(player);
            }
        }
return true;
    }

private void Recall(Player player)
    {

for (Player otherPlayer : GameObjectsStorage.getAllPlayers())
        {
System.out.println(GameObjectsStorage.getAllPlayers());

            int var1 = player.getX(); //admin Location X
            int var2 = player.getY(); //admin Location Y
            int var3 = player.getZ(); //admin Location Z
            int var4 = player.getReflectionId(); //admin Reflection ID

            otherPlayer.teleToLocation(var1+1, var2+1, var3+1, var4);// teleport everything with "for" added +1 to randomize the teleport, this solved the problem "causing char out of control"
        }
    }

 private enum Commands
    {
admin_recall_all
    }

}


Help me complete my other mod:
I need you to check if the item was dropped from a mob, it is just validating the ids currently
@Deazer
 
Last edited:
If I helped, comment something so I can continue doing new things.
Se eu ajudei, comente algo para eu continuar fazendo coisas novas.
 
Back
Top