Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package org.model.players.commands;
- import org.Server;
- import org.model.players.PlayerHandler;
- import org.model.players.client;
- public class AdminCommands extends CommandManager {
- /**
- * @author animeking1120
- * @param c
- * @param command
- */
- public static void adminCommand(final client c, String command) {
- if (command.startsWith("item")) {
- String[] args = command.split(" ");
- if (args.length == 3) {
- int newItemID = Integer.parseInt(args[1]);
- int newItemAmount = Integer.parseInt(args[2]);
- if (newItemID <= 160000 && newItemID >= 0) {
- c.addItem(newItemID, newItemAmount);
- } else {
- c.sM("No such item.");
- }
- } else {
- c.sM("Oops! Use as ::item 995 100");
- }
- } else if (command.startsWith("xteletome")) {
- try {
- String otherPName = command.substring(10);
- int otherPIndex = PlayerHandler.getPlayerID(otherPName);
- if (otherPIndex != -1) {
- client p = (client) Server.playerHandler.players[otherPIndex];
- if (!c.IsInFightCave() && !p.IsInFightCave()) {
- p.toX = c.absX;
- p.toY = c.absY;
- p.heightLevel = c.heightLevel;
- p.updateRequired = true;
- p.appearanceUpdateRequired = true;
- p.sM("You have been teleported to " + c.playerName);
- }
- } else {
- c.sM("The name doesnt exist.");
- }
- } catch (Exception e) {
- c.sM("Try entering a name you want to tele to you..");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement