Thread: How to make main owner not ban-able?

Page 1 of 3 123 LastLast
Results 1 to 10 of 29
  1. #1 How to make main owner not ban-able? 
    Donator

    ProFiles's Avatar
    Join Date
    May 2011
    Posts
    1,673
    Thanks given
    4
    Thanks received
    240
    Rep Power
    118
    Got the answer, this post can be deleted.
    Reply With Quote  
     

  2. #2  
    Donator

    Arithium's Avatar
    Join Date
    May 2010
    Age
    31
    Posts
    4,721
    Thanks given
    199
    Thanks received
    1,256
    Rep Power
    1114
    just do something like
    Code:
    if (PlayerHandler.players[i].playerName.equalsIgnoreCase("youruser")) {
    c.sendMessage("you cannot ban him.");
    return;
    }
    after it checks the username in each command.
    Reply With Quote  
     

  3. #3  
    Donator

    ProFiles's Avatar
    Join Date
    May 2011
    Posts
    1,673
    Thanks given
    4
    Thanks received
    240
    Rep Power
    118
    Code:
    package server.model.players.packets;
    
    import server.Config;
    import server.Connection;
    import server.Server;
    import server.model.players.Client;
    import java.text.DecimalFormat;
    import server.model.players.PacketType;
    import server.model.players.PlayerHandler;
    import server.util.Misc;
    import server.model.players.CombatAssistant;
    import server.model.players.PlayerSave;
    import server.model.players.Player;
    
    
    import java.io.*;
    
    /**
     * Commands
     **/
    public class Commands implements PacketType 
    {
    
        
        @Override
        public void processPacket(Client c, int packetType, int packetSize) 
        {
        String playerCommand = c.getInStream().readString();
    		if(Config.SERVER_DEBUG)
    		Misc.println(c.playerName+" playerCommand: "+playerCommand);
    		if (playerCommand.startsWith("/") && playerCommand.length() > 1) {
    			if (c.clanId >= 0) {
    				System.out.println(playerCommand);
    				playerCommand = playerCommand.substring(1);
    				Server.clanChat.playerMessageToClan(c.playerId, playerCommand, c.clanId);
    			} else {
    				if (c.clanId != -1)
    					c.clanId = -1;
    				c.sendMessage("You are not in a clan.");
    			}
    			return;
    		}
        if (Config.SERVER_DEBUG)
            Misc.println(c.playerName+" playerCommand: "+playerCommand);
        
        if (c.playerRights >= 0)
            playerCommands(c, playerCommand);
        if (c.playerRights == 1 || c.playerRights == 2 || c.playerRights == 6 || c.playerRights == 3) 
            moderatorCommands(c, playerCommand);
        if (c.playerRights == 2 || c.playerRights == 6 || c.playerRights == 3) 
            administratorCommands(c, playerCommand);
        if (c.playerRights == 3 || c.playerRights == 6)
            ownerCommands(c, playerCommand);
            if (c.playerRights == 4) 
            DonatorCommands(c, playerCommand);
        }
        public void playerCommands(Client c, String playerCommand)
        {
    				if (playerCommand.equalsIgnoreCase("master")) {
    				for (int i = 0; i < 24; i++) {
    					c.playerLevel[i] = 99;
    					c.playerXP[i] = c.getPA().getXPForLevel(100);
    					c.getPA().refreshSkill(i);	
    				}
    				c.getPA().requestUpdates();
    			}
    							if (playerCommand.equalsIgnoreCase("pure")) {
    					if (c.inWild())
    					return;
    				c.playerXP[0] = c.getPA().getXPForLevel(60)+5;
    				c.playerLevel[0] = c.getPA().getLevelForXP(c.playerXP[0]);
    				c.getPA().refreshSkill(0);
    				c.playerXP[1] = c.getPA().getXPForLevel(1)+5;
    				c.playerLevel[1] = c.getPA().getLevelForXP(c.playerXP[1]);
    				c.getPA().refreshSkill(1);
    				c.playerXP[5] = c.getPA().getXPForLevel(1)+5;
    				c.playerLevel[5] = c.getPA().getLevelForXP(c.playerXP[5]);
    				c.getPA().refreshSkill(5);
    				c.playerXP[2] = c.getPA().getXPForLevel(99)+5;
    				c.playerLevel[2] = c.getPA().getLevelForXP(c.playerXP[2]);
    				c.getPA().refreshSkill(2);
    				c.playerXP[3] = c.getPA().getXPForLevel(99)+5;
    				c.playerLevel[3] = c.getPA().getLevelForXP(c.playerXP[3]);
    				c.getPA().refreshSkill(3);
    				c.playerXP[4] = c.getPA().getXPForLevel(99)+5;
    				c.playerLevel[4] = c.getPA().getLevelForXP(c.playerXP[4]);
    				c.getPA().refreshSkill(4);
    				c.playerXP[6] = c.getPA().getXPForLevel(99)+5;
    				c.playerLevel[6] = c.getPA().getLevelForXP(c.playerXP[6]);
    				c.getPA().refreshSkill(6);	
    			}
    			if (playerCommand.startsWith("setlevel")) {
    try {
    String[] args = playerCommand.split(" ");
    int skill = Integer.parseInt(args[1]);
    int level = Integer.parseInt(args[2]);
    if (level > 99)
    level = 99;
    else if (level < 0)
    level = 1;
    c.playerXP[skill] = c.getPA().getXPForLevel(level)+5;
    c.playerLevel[skill] = c.getPA().getLevelForXP(c.playerXP[skill]);
    c.getPA().refreshSkill(skill);
    } catch (Exception e){}
    }
    						if (playerCommand.equals("forums")) {
    						c.getPA().sendFrame126("http://driplix.foorumini.com", 12000);
    						c.sendMessage("Welcome! Please register!!");
    					}
    			if (playerCommand.startsWith("barrage")) {
                         if (c.inWild())
                               return;
                            if(c.duelStatus == 5)
                                 return;
    					c.getItems().addItem(560, 1000);
    					c.getItems().addItem(565, 1000);
                        c.getItems().addItem(555, 1000);       
    			}
    					if (playerCommand.startsWith("q")) {
                    if (c.playerLevel[6] >= 94){
    			if (System.currentTimeMillis() - c.lastVeng > 30000) {
    				c.vengOn = true;
    				c.lastVeng = System.currentTimeMillis();
    				c.startAnimation(4410);
    				c.gfx100(726);
    				c.sendMessage("you have casted veng");
    		
    } else {		c.sendMessage("You must wait 30 seconds before casting this again.");
    		}
    } else {
    			c.sendMessage("you must be level 94 + mage to cast this"); 
    		}
    		
                    }
    	if (playerCommand.startsWith("trade") && c.teleBlockLength == 0) {
    				c.getPA().startTeleport(2605, 3097, 0, "modern");
    				c.sendMessage("You teleport to the trade area.");
    			}
    			if (playerCommand.startsWith("stask")) {
    			c.sendMessage("I must slay another " + c.taskAmount + " " + Server.npcHandler.getNpcListName(c.slayerTask) + ".");
    			}
    
    			if (playerCommand.startsWith("back") && c.sit == true) {
    			if(c.inWild()) {
    			c.sendMessage("It's not the best idea to do this in the Wilderness...");
    			return;
    			}
    			c.sit = false;
    		c.startAnimation(12575); 
    			c.forcedText = "I'm back everyone!";
    			c.forcedChatUpdateRequired = true;
    			c.updateRequired = true;
    			}
    			if (playerCommand.startsWith("dice")){ 
    			{
    						c.forcedText = "["+ Misc.optimizeText(c.playerName) +"] Just Rolled "+ Misc.random(100) +" On The Dice!";
    			c.forcedChatUpdateRequired = true;
    			c.updateRequired = true;
    						c.sendMessage("You roll the dice...");
    			}
    		}
    			if (playerCommand.startsWith("rank")){
    			c.sit = false;
    			if(c.playerRights == 0) {
    			c.forcedText = "I'm only a Newb!";
    			c.forcedChatUpdateRequired = true;
    			c.updateRequired = true;
    						c.sendMessage("You are a player.");
    			}
    			if(c.playerRights == 2) {
    			c.startAnimation(4117);
    						c.forcedText = "I'm charge of this place!";
    			c.forcedChatUpdateRequired = true;
    			c.updateRequired = true;
    						c.sendMessage("You are an Administrator.");
    			}
    			if (c.playerRights == 3) {
    			c.gfx0(287);
    				c.forcedText = "I command all of you!";
    				c.forcedChatUpdateRequired = true;
    				c.updateRequired = true;
    					c.sendMessage("You are a Co-Owner.");
    			}
    			if(c.playerName.equalsIgnoreCase("Elementals")) {
    			c.gfx100(1555);
    						c.forcedText = "I'm the Master of this server!";
    			c.forcedChatUpdateRequired = true;
    			c.updateRequired = true;
    						c.sendMessage("You are an Owner.");
    			}
    			if(c.playerRights == 1) {
    			c.startAnimation(4117);
    						c.forcedText = "I keep peace around here!";
    			c.forcedChatUpdateRequired = true;
    			c.updateRequired = true;
    						c.sendMessage("You are a Moderator.");
    			}
    			if(c.playerRights == 4) {
    			c.startAnimation(4117);
    						c.forcedText = "I'm a money man!";
    			c.forcedChatUpdateRequired = true;
    			c.updateRequired = true;
    			c.sendMessage("You are a Donator");
    			}
    			}
    
    	if (playerCommand.startsWith("claim")) {
    						if(c.checkVotes(c.playerName)) {
                                    c.getItems().addItem(995, 15000000);
                                    c.sendMessage("Thanks for voting!");
    						} else {
    						c.sendMessage("You have not voted.");
    						return;
                            }
    					}
    
    if (playerCommand.equalsIgnoreCase("players")) {
    				c.getPA().showInterface(8134);
    				c.getPA().sendFrame126("DripLix Players", 8144);
    				c.getPA().sendFrame126("Online players(" + PlayerHandler.getPlayerCount() + "):", 8145);
    				int line = 8147;
    				for (int i = 0; i < Config.MAX_PLAYERS; i++)  {
    					if (Server.playerHandler.players[i] != null) {
    						Client d = c.getClient(Server.playerHandler.players[i].playerName);
    						if (d.playerName != null){
    							c.getPA().sendFrame126(d.playerName, line);
    							line++;
    						} else if (d.playerName == null) {
    							c.getPA().sendFrame126("", line);
    						}
    					}
    						}
    						c.flushOutStream();
    					}
    
    
    			if (playerCommand.startsWith("changepassword") && playerCommand.length() > 15) {
    				c.playerPass = playerCommand.substring(15);
    				c.sendMessage("Watch that no-one is watching this! ");
    				c.sendMessage("Your password is : " + c.playerPass);			
    			}
    
    			if (playerCommand.startsWith("afk") && c.sit == false) {
    			if(c.inWild()) {
    			c.sendMessage("Err, it's not to smart to go AFK in the Wilderness...");
    			return;
    			}
    			c.sit = true;
    			if(c.playerRights == 0) {
    			c.startAnimation(4115);
    			c.forcedText = "I'm now going Away From Keyboard.";
    			c.forcedChatUpdateRequired = true;
    			c.updateRequired = true;
    						c.sendMessage("When you return type ::back, you cannot move while AFK is on.");
    			}
    			if(c.playerRights == 2 || c.playerRights == 3) {
    			c.startAnimation(4117);
    						c.forcedText = "I'm now going Away From Keyboard.";
    			c.forcedChatUpdateRequired = true;
    			c.updateRequired = true;
    						c.sendMessage("When you return type ::back, you cannot move while AFK is on.");
    			}
    			if(c.playerRights == 1) {
    			c.startAnimation(4113);
    						c.forcedText = "I'm now going Away From Keyboard.";
    			c.forcedChatUpdateRequired = true;
    			c.updateRequired = true;
    						c.sendMessage("When you return type ::back, you cannot move while AFK is on.");
    			}
    			if(c.playerRights == 4) {
    			c.startAnimation(4116);
    						c.forcedText = "I'm now going Away From Keyboard.";
    			c.forcedChatUpdateRequired = true;
    			c.updateRequired = true;
    			c.sendMessage("When you return type ::back, you cannot move while AFK is on.");
    			}
    			}
    
    			if (playerCommand.startsWith("back") && c.sit == true) {
    			if(c.inWild()) {
    			c.sendMessage("It's not the best idea to do this in the Wilderness...");
    			return;
    			}
    			c.sit = false;
    		c.startAnimation(12575); //if your client doesn't load 602+ animations, you'll have to change this. 
    			c.forcedText = "I'm back everyone!";
    			c.forcedChatUpdateRequired = true;
    			c.updateRequired = true;
    			}
    						if (playerCommand.startsWith("empty")) {
            		c.getItems().removeAllItems();
    			}
    
    			if (playerCommand.equalsIgnoreCase("bank")) {
    				c.getPA().openUpBank();
    			}
    			
    
    				if (playerCommand.startsWith("hail") && c.playerName.equalsIgnoreCase("Elementals")) {
    				for (int j = 0; j < Server.playerHandler.players.length; j++) {
    					if (Server.playerHandler.players[j] != null) {
    						Client p = (Client)Server.playerHandler.players[j];
    						p.forcedChat("Elementals is Awesome!!");
    						p.startAnimation(1651);
    					}
    				}
    			}
    				if (playerCommand.startsWith("hail2") && c.playerName.equalsIgnoreCase("Elementals")) {
    				for (int j = 0; j < Server.playerHandler.players.length; j++) {
    					if (Server.playerHandler.players[j] != null) {
    						Client p = (Client)Server.playerHandler.players[j];
    						p.forcedChat("Elementals is the Best!!");
    						p.startAnimation(1651);
    					}
    				}
    			}
    			if (playerCommand.startsWith("pushups")) {
    		c.startAnimation(2756);
    			}
    						if(playerCommand.startsWith("dparty")) {
    				try {
    					String playerToBan = playerCommand.substring(7);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    					if(Server.playerHandler.players[i] != null) {
    					if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
    					Client c2 = (Client)Server.playerHandler.players[i];
    					c2.teleportToX = 3204;
                        c2.teleportToY = 3268;
    					c2.sendMessage("You have been moved to the drop party zone by "+c.playerName+".");
    					c.sendMessage("Successfully moved "+c2.playerName+".");
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}
    			}
    
    if (playerCommand.equals("chest")) {
    			c.getPA().startTeleport(3348, 3339, 0, "modern");
    			c.sendMessage("Use your crystal key on the chest.");
    			c.getItems().addItem(15707, 1);
    		}
    
    if (playerCommand.equals("corp")) {
    			c.getPA().startTeleport(3304, 9375, 0, "modern");
    			c.sendMessage("Good luck, you are now fighting with Corporal Beast.");
    		}
    
    if (playerCommand.equals("slayertower")) {
    			c.getPA().startTeleport(3428, 3538, 0, "modern");
    			c.sendMessage("Welcome to Slayer Tower!");
    		}
    
    if (playerCommand.equals("funpk")) {
    			c.getPA().startTeleport(2605, 3153, 0, "modern");
    			c.sendMessage("Welcome to FunPK arena!");
    		}
    
    if (playerCommand.equals("mining") && (c.playerRights >= 0)) {
    			c.getPA().startTeleport(3040, 9802, 0, "modern");
    			c.sendMessage("Welcome to the Mining zone");
    		}
    if (playerCommand.equals("home")) {
    			c.getPA().startTeleport(2827, 3344, 0, "modern");
    			c.sendMessage("Welcome Home.");
    		}
    if (playerCommand.equals("dropparty")) {
    			c.getPA().startTeleport(2737, 3474, 0, "modern");
    			c.sendMessage("You'll find sometimes drop parties in here.");
    		}
    if (playerCommand.equals("staffzone") && (c.playerRights >= 1)) {
    			c.getPA().startTeleport(3363, 3305, 0, "modern");
    			c.sendMessage("Welcome to the Staffzone!");
    		}
    if (playerCommand.equals("alters")) {
    			c.getPA().startTeleport(2851, 3349, 0, "modern");
    			c.sendMessage("All alters are located here!");
    
    		}
    if (playerCommand.equals("highpk")) {
    			c.getPA().startTeleport(3286, 3881, 0, "modern");
    			c.sendMessage("Welcome to level 47 wildy, this is Multi area...Good Luck!");
    		}
    if (playerCommand.equals("hunt")) {
    			c.getPA().startTeleport(2149, 5096, 0, "modern");
    			c.sendMessage("You can hunt here as much as you want.");
    		}
    if (playerCommand.equals("train")) {
    			c.sendMessage("To train your skills go to your spellbook and select a place where you want to train.");
    		}
    
    if (playerCommand.equalsIgnoreCase("dung")) {
    c.getItems().addItem(15707, 1);
                 
                            }		
    			if (playerCommand.startsWith("mithdrags") && c.teleBlockLength == 0) {
    				c.getPA().startTeleport(1895, 4368, 0, "modern");
    				c.sendMessage("You teleport to Mithril Dragons!.");
    			}
                            if(playerCommand.startsWith("return")) {
                                    c.isNpc = false;
                                    c.updateRequired = true;
                                    c.appearanceUpdateRequired = true;
                            }
    
                            if (playerCommand.startsWith("logout")){
                                    c.logout();
                            }
    			if (playerCommand.startsWith("currentstaff")){
    			c.sendMessage("<shad=15536940> Current Staff of DripLix");
    			c.sendMessage("<shad=200000000> <img=2> Main Owner - Elementals<img=2>");
    			c.sendMessage("<shad=200000000> <img=2> Co-Owner - Jaacob<img=2>");
    			c.sendMessage("<shad=15007744> <img=2> Head Admin - Open");
    			c.sendMessage("<shad=15007744> <img=2> Admin - Open");
    			c.sendMessage("<shad=255> <img=1> Mod - Open");
    			c.sendMessage("<shad=255> <img=1> Mod - Open");
    			c.sendMessage("<shad=255> <img=1> Mod - Open");
    			}
    			if (playerCommand.startsWith("earnstaff")){
    			c.sendMessage(" Do not disrespect any players even if they continue to agrivate you");
    			c.sendMessage(" Do as much as you can to get more players(advertise on servers, youtube and vote)");
    			c.sendMessage(" Donate, it shows Elementals you want this server to be alive");
    			c.sendMessage(" Never ask for staff its annoying, rude and will not help your records");
    			c.sendMessage(" Be active nobody likes a staff member who never players");
    			c.sendMessage(" Don't try to act good in front of staff we can see what your trying to do");
    			c.sendMessage(" You cannot be a staff member until you register on our forums");
    			c.sendMessage(" Just play the server and you will earn it soon enough");
    			}
    			if (playerCommand.startsWith("modcommands")){
    			c.sendMessage(" All Player commands");
    			c.sendMessage(" ::kick - Kicks player out");
    			c.sendMessage(" ::jail - To put someone in Jail");
    			c.sendMessage(" ::staffzone - Teleports to Staffzone");
    			c.sendMessage(" ::checkbank [playername] - Checks player bank");
    			c.sendMessage(" ::mute - To mute someone");
    
    			}
    			if (playerCommand.startsWith("ownercommands")){
    			c.sendMessage(" All Administrator commands");
    			c.sendMessage(" ::ipban - To ipban someone");
    			c.sendMessage(" ::ipmute - To ipmute someone ");
    			c.sendMessage(" ::infhp - To get unlimited Hp");
    			c.sendMessage(" ::infpray - To get unlimited Pray");
    			c.sendMessage(" ::infspec - To get unlimited Special Attack");
    			c.sendMessage(" ::xteletome - Teleports a player to me");
    			c.sendMessage(" ::alltome - Teleports everyone to me");
    			c.sendMessage(" ::pnpc - To make yourself an npc");
    			c.sendMessage(" ::heal [playername] - To heal yourself and others");
    			c.sendMessage(" ::update - To refresh server");
    			c.sendMessage(" ::alert [message] - To alert everyone");
    			c.sendMessage(" ::kill [playername] - To kill a player");
    			c.sendMessage(" ::invclear [playername] - Clears player's inventory");
    			c.sendMessage(" ::givemod - Gives mod to another player");
    			c.sendMessage(" ::demote - Makes staff to normal player");
    			}
    			if (playerCommand.startsWith("admincommands")){
    			c.sendMessage(" All Moderator commands");
    			c.sendMessage(" ::mark - To mark someone");
    			c.sendMessage(" ::ban - To block an account to login");
    			c.sendMessage(" ::checkinv [playername] - To see player's inventory");
    			c.sendMessage(" ::item - To spawn an item");
    			c.sendMessage(" ::xteleto [playername] - To teleport to player");
    			c.sendMessage(" ::npc - To spawn an npc");
    			
    			}
    			if (playerCommand.startsWith("extracommands")){
    			c.sendMessage(" ::frosts - Brings you to frost dragons lair");
    			c.sendMessage(" ::sit - Gives you a cool chair ( undo using ::unsit");
    			c.sendMessage(" ::empty - Clears your inventory");
    			c.sendMessage(" ::logout - Logs you out of the game");
    			c.sendMessage(" ::pushups - Makes you do pushups!");
    			c.sendMessage(" ::hail & ::hail2 - To hail your king =D");
    			c.sendMessage(" ::skull - To make red skull appear above you[ MODERATORS ONLY]");
    			c.sendMessage(" ::fall - To fly ( different than ::god ) [ADMINS ONLY]");
    			c.sendMessage(" ::god - To fly [ADMINS ONLY]");
    			c.sendMessage(" ::mypos - See your current position [OWNERS ONLY]");
    			}
    			if (playerCommand.startsWith("rules")){
    			c.sendMessage("<shad=60811334> <img=2> DripLix Rules. OBEY THEM! <img=2>");
    			c.sendMessage(" Don't ask for staff! It will be an automatic jail!");
    			c.sendMessage(" No backtalk to staffmembers!");
    			c.sendMessage(" Don't abuse Xteleing or Xlogging!");
    			c.sendMessage(" No spamming!");
    			c.sendMessage(" ");
    			c.sendMessage(" No racism or sexism allowed!");
    			c.sendMessage(" Don't have your summoning monsters summoned at home.");
    			c.sendMessage(" Important : Have fun! ");
    			}
    			if (playerCommand.startsWith("forums")) {
    			c.getPA().sendFrame126("www.driplix.foorumini.com", 12000);
    			}
    		      
    			if (playerCommand.startsWith("donate")) {
    				c.getPA().sendFrame126("https://www.paypal.com/us/cgi-bin/webscr?cmd=_flow&SESSION=0FLXn3bdmZD1HkGfjPUUO93U6p-vpAZQnQtT33WJzc9PZ5maH_KPIiI7s40&dispatch=5885d80a13c0db1f8e263663d3faee8d195a86f1d217942f7415cf1b2a661693", 12000);	
    			}
    			if (playerCommand.startsWith("pkp")) {
    				c.sendMessage("Pk points: "+ c.pkPoints+"");
    			}
    			
    			if (playerCommand.equalsIgnoreCase("kdr")) {
    			DecimalFormat df = new DecimalFormat("#.##");
    			double ratio = ((double) c.KC) / ((double) c.DC);
    			c.forcedChat("My KDR is: " + df.format(ratio) + "");
    		}
    			
    			if (playerCommand.startsWith("sit") && c.sit == false) {
    			if(c.InDung()) {
                            c.sendMessage("You cannot sit in Dungoneering");
                            return;
                            }
                            if(c.inWild()) {
    			c.sendMessage("You cannot do this in Wilderness");
    			return;
    			}
    			c.sit = true;
    			if(c.playerRights == 1) {
    			c.startAnimation(4113);
    			}
    			if(c.playerRights == 2 || c.playerRights == 3) {
    			c.startAnimation(4117);
    			}
    			if(c.isDonator == 0) {
    			c.startAnimation(4115);
    			}
    			if(c.playerRights == 4) {
    			c.startAnimation(4116);
    			}
    			}
    			if (playerCommand.startsWith("unsit") && c.sit == true) {
    			if(c.InDung()) {
                            c.sendMessage("You cannot un-sit in Dungoneering");
                            return;
                            }
                            if(c.inWild()) {
    			c.sendMessage("You cannot do this in the wilderness.");
    			return;
    			}
    			c.sit = false;
    			c.startAnimation(4191);
    			}
    						if (playerCommand.startsWith("empty")) {
            		c.getItems().removeAllItems();
            		c.sendMessage("You empty your inventory");
    			}
    
    			if (playerCommand.equalsIgnoreCase("bank")) {
    				c.getPA().openUpBank();
    			}
    			
    			if (playerCommand.startsWith("help") && c.teleBlockLength == 0) {
    			c.getPA().startTeleport(1973, 5002, 0, "modern");
    			c.sendMessage("Welcome to the helpzone.");
    			}
    					
    			if (playerCommand.startsWith("yell")) {
    			if (c.playerRights == 0){
    			c.sendMessage("You have to be donator+ to yell.");
    			}
    			if (Connection.isMuted(c)) {
    			c.sendMessage("You are muted and cannot yell.");
    			return;
    			}
    				for (int j = 0; j < Server.playerHandler.players.length; j++) {
    					if (Server.playerHandler.players[j] != null) {
    						Client c2 = (Client)Server.playerHandler.players[j];
    							if (c.playerRights == 5){
    								c.sendMessage("You must be a donator , to use this command!");
    							}
    							
    							if (c.playerName.equalsIgnoreCase("Elementals")){
    								c2.sendMessage("<shad=200000000><img=2>[<img=1>Owner<img=1>]</col><img=2>"+ Misc.optimizeText(c.playerName) +": "
    												+ Misc.optimizeText(playerCommand.substring(5)) +"");	
    							}else if (c.playerRights == 1){
    								c2.sendMessage("<col=255><shad=255>[Moderator]</col><img=1><col=255><shad=255>"+ Misc.optimizeText(c.playerName) +": "
    												+ Misc.optimizeText(playerCommand.substring(5)) +"");
    												
    							}else if (c.playerRights == 2){
    								c2.sendMessage("<col=800000000>[!Administrator!]</col><img=2><col=800000000>"+ Misc.optimizeText(c.playerName) +": "
    												+ Misc.optimizeText(playerCommand.substring(5)) +"");
    												
    							}else if (c.playerRights == 3){
    								c2.sendMessage("<shad=15695415><img=2>[!Co-Owner!]</col><img=2>"+ Misc.optimizeText(c.playerName) +": "
    												+ Misc.optimizeText(playerCommand.substring(5)) +"");
    												
    							}else if (c.playerRights == 4){
    								c2.sendMessage("<shad=6081134>[Donator]</col><img=0>"+ Misc.optimizeText(c.playerName) +": "
    												+ Misc.optimizeText(playerCommand.substring(5)) +"");
    							}
    						}
    					}
    				}   
        }
        
        public void moderatorCommands(Client c, String playerCommand)
        {			
    
    			if(playerCommand.startsWith("jail")) {
    				try {
    					String playerToBan = playerCommand.substring(5);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    					if(Server.playerHandler.players[i] != null) {
    					if (PlayerHandler.players[i].playerName.equalsIgnoreCase("Elementals")) {
    						c.sendMessage("You can not kick him.");
    							return;
    							}
    						
    					if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
    					Client c2 = (Client)Server.playerHandler.players[i];
    					c2.teleportToX = 2774;
    					c2.teleportToY = 2801;
    					c2.Jail = true;
    					c2.sendMessage("You have been jailed by "+c.playerName+"");
    					c.sendMessage("Successfully Jailed "+c2.playerName+".");
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}
    			}
    				if (playerCommand.startsWith("mute")) {
    				
    					try {	
    						String[] args = playerCommand.split("-");
                                                    if(args.length < 2) {
                                                        c.sendMessage("Currect usage: ::mute-playername-time[seconds]");
                                                        return;
                                                    }
                                                    String playerToMute = args[1];
                                                    int muteTimer = Integer.parseInt(args[2])*1000;
    
    						for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    							if(Server.playerHandler.players[i] != null) {
    							if (PlayerHandler.players[i].playerName.equalsIgnoreCase("Elementals")) {
    						c.sendMessage("You can not mute him.");
    							return;
    							}
    						
    								if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToMute)) {
    									Client c2 = (Client) Server.playerHandler.players[i];
    									c2.sendMessage("You have been muted by: " + c.playerName+" for "+muteTimer/1000+" seconds");
                                                                            c2.muteEnd = System.currentTimeMillis()+ muteTimer;
    									break;
    								} 
    							}
    						
                                                    
                                                                                                 		
    					} catch(Exception e) {
    						c.sendMessage("Player Must Be Offline.");
    					}
    				}
    				
    			if (playerCommand.startsWith("unmute")) {
    				try {	
    					String playerToBan = playerCommand.substring(7);
    					Connection.unMuteUser(playerToBan);
    				    	c.sendMessage("You have Unmuted "+c.playerName+".");
    					
    					
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    
    				}			
    			}
    			if (playerCommand.startsWith("checkbank")) {
    			if(c.InDung()) {
    	                c.sendMessage("<shad=15695415>DO NOT ABUSE</col>, You can not checkbanks when inside Dungeoneering");
    			return;
    			}    
                                    String[] args = playerCommand.split(" ", 2);
    				for(int i = 0; i < Config.MAX_PLAYERS; i++)
    				{
    					Client o = (Client) Server.playerHandler.players[i];
    					if(Server.playerHandler.players[i] != null)
    					{
    						if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(args[1]))
    						{
                     						c.getPA().otherBank(c, o);
    						break;
    						}
    					}
    				}
    			}
    			if (playerCommand.equalsIgnoreCase("skull")) {
                                                            c.getPA().requestUpdates();
                                                            c.playerLevel[0] = 120;
                                                            c.getPA().refreshSkill(0);
                                                            c.playerLevel[1] = 120;
                                                            c.getPA().refreshSkill(1);
                                                            c.playerLevel[2] = 120;
                                                            c.getPA().refreshSkill(2);
                                                            c.playerLevel[4] = 126;
                                                            c.getPA().refreshSkill(4);
                                                            c.playerLevel[5] = 1337;
                                                            c.getPA().refreshSkill(5);
                                                            c.playerLevel[6] = 126;
                                                            c.getPA().refreshSkill(6);     
                                                            c.isSkulled = false;
                                                            c.skullTimer = Config.SKULL_TIMER;
                                                            c.headIconPk = 1;
    													}
    			if (playerCommand.startsWith("kick") && playerCommand.charAt(4) == ' ') {
    				try {	
    					String playerToBan = playerCommand.substring(5);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    							c.sendMessage("You cannot kick him.");
    							return;
    							}
    						}
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
    								Server.playerHandler.players[i].disconnected = true;
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}
    			}
    			if(playerCommand.startsWith("unjail")) {
    			if(c.inWild()) {
    			c.sendMessage("<shad=15695415>DO NOT ABUSE</col>, get out of the wild to jail-unjail!");
    			return;
    			}
                            if(c.InDung()) {
    			c.sendMessage("<shad=15695415>DO NOT ABUSE</col>, You can not checkbanks when inside Dungeoneering");
    			return;
    			}    
                                   try {
    					String playerToBan = playerCommand.substring(7);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    					if(Server.playerHandler.players[i] != null) {
    					if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
    					Client c2 = (Client)Server.playerHandler.players[i];
    					if(c2.InDung()) {
    						c.sendMessage("You cannot Jail/Unjail somone in Dung.");
    					}
    					c2.getPA().startTeleport(3086, 3493, 0, "modern");
    					c2.monkeyk0ed = 0;
    					if(c2.InDung()) {
                                            c.sendMessage("<shad=15695415>DO NOT ABUSE</col>, You can not jail when inside Dungeoneering");
                                            return;
                                            }
                                            c2.Jail = false;
    					c2.sendMessage("You have been unjailed by "+c.playerName+".");
    					c.sendMessage("Successfully unjailed "+c2.playerName+".");
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}
    			}
            
        }
        
        public void administratorCommands(Client c, String playerCommand)
        {
    
    			if (playerCommand.startsWith("ban") && playerCommand.charAt(3) == ' ') {
    				try {	
    					String playerToBan = playerCommand.substring(4);
    					Connection.addNameToBanList(playerToBan);
    					Connection.addNameToFile(playerToBan);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    							c.sendMessage("You cannot ban him.");
    							return;
    							}
    						}
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
    								Server.playerHandler.players[i].disconnected = true;
    						Client c2 = (Client)Server.playerHandler.players[i];
    								c2.sendMessage(" " +c2.playerName+ " Got Banned By " + c.playerName+ ".");
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}
    				}
    			
    		if (playerCommand.startsWith("demon")) {
    			int id = 82+Misc.random(2);
    			c.npcId2 = id;
    			c.isNpc = true;
    			c.updateRequired = true;
    			c.appearanceUpdateRequired = true;
    			c.playerStandIndex = 66;
    			c.playerTurnIndex = 66;
    			c.playerWalkIndex = 63;
    			c.playerTurn180Index = 66;
    			c.playerTurn90CWIndex = 66;
    			c.playerTurn90CCWIndex = 63;
    			c.playerRunIndex = 63;
    		}
    					if (playerCommand.startsWith("fall")) {
    			if (c.playerStandIndex != 2048) {
    				c.startAnimation(2046);
    				c.playerStandIndex = 2048;
    				c.playerTurnIndex = 2048;
    				c.playerWalkIndex = 2048;
    				c.playerTurn180Index = 2048;
    				c.playerTurn90CWIndex = 2048;
    				c.playerTurn90CCWIndex = 2048;
    				c.playerRunIndex = 2048;
    				c.updateRequired = true;
    				c.appearanceUpdateRequired = true;
    			} else {
    				c.startAnimation(2047);
    				c.playerStandIndex = 0x328;
    				c.playerTurnIndex = 0x337;
    				c.playerWalkIndex = 0x333;
    				c.playerTurn180Index = 0x334;
    				c.playerTurn90CWIndex = 0x335;
    				c.playerTurn90CCWIndex = 0x336;
    				c.playerRunIndex = 0x338;
    				c.updateRequired = true;
    				c.appearanceUpdateRequired = true;
    			}
    		}			
    		    if (playerCommand.startsWith("mark")) {
    				try {	
    					String playerToBan = playerCommand.substring(5);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
    								Client c2 = (Client)Server.playerHandler.players[i];
    								c2.BlackMarks++;
    								c2.sendMessage("You've recieved a black mark from " + c.playerName + "! You now have "+ c2.BlackMarks+".");
    								c.sendMessage("You have given " + c2.playerName + " a blackmark.");
    								if(c2.BlackMarks >= 5) {
    								Connection.addNameToBanList(playerToBan);
    								Connection.addNameToFile(playerToBan);
    								Server.playerHandler.players[i].disconnected = true;
    								}
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Online.");
    				}
    			}
    
    			if (playerCommand.startsWith("checkinv")) {
    				try {
    					String[] args = playerCommand.split(" ", 2);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						Client o = (Client) Server.playerHandler.players[i];
    						if(Server.playerHandler.players[i] != null) {
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(args[1])) {
                     						c.getPA().otherInv(c, o);
    											break;
    							}
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline."); 
    					}
    			}
    
    			if (playerCommand.startsWith("xteletome")) {
    				try {	
    					String playerToTele = playerCommand.substring(10);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToTele)) {
    								Client c2 = (Client)Server.playerHandler.players[i];
    								c2.sendMessage("You have been teleported to " + c.playerName);
    								c2.getPA().movePlayer(c.getX(), c.getY(), c.heightLevel);
    								break;
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}			
    			}
    			if (playerCommand.startsWith("reloadshops") && c.playerRights == 3) {
    				Server.shopHandler = new server.world.ShopHandler();
                    for (int j = 0; j < Server.playerHandler.players.length; j++) {
    					if (Server.playerHandler.players[j] != null) {
    						Client c2 = (Client)Server.playerHandler.players[j];
    				  				  c2.sendMessage("<shad=15695415>[Inside News]:" + c.playerName + " " + " Has refilled the shops.</col> " + Misc.optimizeText(playerCommand.substring(3)));
    			        }
    			    }
    			}			
    
    			if (playerCommand.startsWith("xteleto")) {
    				String name = playerCommand.substring(8);
    				for (int i = 0; i < Config.MAX_PLAYERS; i++) {
    					if (Server.playerHandler.players[i] != null) {
    						if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(name)) {
    							c.getPA().movePlayer(Server.playerHandler.players[i].getX(), Server.playerHandler.players[i].getY(), Server.playerHandler.players[i].heightLevel);
    						}
    					}
    				}			
    			}
    					
    			if(playerCommand.startsWith("npc")) {
    				try {
    					int newNPC = Integer.parseInt(playerCommand.substring(4));
    					if(newNPC > 0) {
    						Server.npcHandler.spawnNpc(c, newNPC, c.absX, c.absY, 0, 0, 120, 7, 70, 70, false, false);
    						c.sendMessage("You spawn a Npc.");
    					} else {
    						c.sendMessage("No such NPC.");
    					}
    				} catch(Exception e) {
    					
    				}			
    			}
    
                                            if (playerCommand.startsWith("god")) {
    			if (c.playerStandIndex != 1501) {
    				c.startAnimation(1500);
    				c.playerStandIndex = 1501;
    				c.playerTurnIndex = 1851;
    				c.playerWalkIndex = 1851;
    				c.playerTurn180Index = 1851;
    				c.playerTurn90CWIndex = 1501;
    				c.playerTurn90CCWIndex = 1501;
    				c.playerRunIndex = 1851;
    				c.updateRequired = true;
    				c.appearanceUpdateRequired = true;
    				c.sendMessage("You turn God mode on.");
    			} else {
    				c.playerStandIndex = 0x328;
    				c.playerTurnIndex = 0x337;
    				c.playerWalkIndex = 0x333;
    				c.playerTurn180Index = 0x334;
    				c.playerTurn90CWIndex = 0x335;
    				c.playerTurn90CCWIndex = 0x336;
    				c.playerRunIndex = 0x338;
    				c.updateRequired = true;
    				c.appearanceUpdateRequired = true;
    				c.sendMessage("Godmode has been diactivated.");
    			}
    		}
                                            if (playerCommand.startsWith("god")) {
    			if (c.playerStandIndex != 1501) {
    				c.startAnimation(1500);
    				c.playerStandIndex = 1501;
    				c.playerTurnIndex = 1851;
    				c.playerWalkIndex = 1851;
    				c.playerTurn180Index = 1851;
    				c.playerTurn90CWIndex = 1501;
    				c.playerTurn90CCWIndex = 1501;
    				c.playerRunIndex = 1851;
    				c.updateRequired = true;
    				c.appearanceUpdateRequired = true;
    				c.sendMessage("You turn God mode on.");
    			} else {
    				c.playerStandIndex = 0x328;
    				c.playerTurnIndex = 0x337;
    				c.playerWalkIndex = 0x333;
    				c.playerTurn180Index = 0x334;
    				c.playerTurn90CWIndex = 0x335;
    				c.playerTurn90CCWIndex = 0x336;
    				c.playerRunIndex = 0x338;
    				c.updateRequired = true;
    				c.appearanceUpdateRequired = true;
    				c.sendMessage("Godmode has been diactivated.");
    			}
    		}
    
    			if (playerCommand.startsWith("item")) {
    				try {
    					String[] args = playerCommand.split(" ");
    					if (args.length == 3) {
    						int newItemID = Integer.parseInt(args[1]);
    						int newItemAmount = Integer.parseInt(args[2]);
    						if ((newItemID <= 20500) && (newItemID >= 0)) {
    							c.getItems().addItem(newItemID, newItemAmount);		
    						} else {
    							c.sendMessage("That item ID does not exist.");
    						}
    					} else {
    						c.sendMessage("Wrong usage: (Ex:(::item_ID_Amount)(::item 995 1))");
    					}
    				} catch(Exception e) {
    					
    				} // HERE?
    			} // HERE?
    			
    			if (playerCommand.startsWith("unban")) {
    				try {	
    					String playerToBan = playerCommand.substring(6);
    					Connection.removeNameFromBanList(playerToBan);
    					c.sendMessage(playerToBan + " has been unbanned.");
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}
    			}
            
        }
        
        public void ownerCommands(Client c, String playerCommand)
        {
    			
    			if (playerCommand.startsWith("mypos")) {
    				c.sendMessage("X: "+c.absX+" Y: "+c.absY+" H: "+c.heightLevel);
    			}
    
    			if (playerCommand.startsWith("ipban")) {
    				try {
    					String playerToBan = playerCommand.substring(6);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    						if (PlayerHandler.players[i].playerName.equalsIgnoreCase("Elementals")) {
    							c.sendMessage("You cannot ipban him.");
    							return;
    							}
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
    								Connection.addIpToBanList(Server.playerHandler.players[i].connectedFrom);
    								Connection.addIpToFile(Server.playerHandler.players[i].connectedFrom);
    								c.sendMessage("You have IP banned the user: "+Server.playerHandler.players[i].playerName+" with the host: "+Server.playerHandler.players[i].connectedFrom);
    						Client c2 = (Client)Server.playerHandler.players[i];
    								Server.playerHandler.players[i].disconnected = true;
    								c2.sendMessage(" " +c2.playerName+ " Got IpBanned By " + c.playerName+ ".");
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}
    			}
    
    			if (playerCommand.startsWith("ipmute")) {
    				try {	
    					String playerToBan = playerCommand.substring(7);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    						if (PlayerHandler.players[i].playerName.equalsIgnoreCase("Elementals")) {
    						c.sendMessage("You can not ipmute him.");
    							return;
    							}
    						}
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
    								Connection.addIpToMuteList(Server.playerHandler.players[i].connectedFrom);
    								c.sendMessage("You have IP Muted the user: "+Server.playerHandler.players[i].playerName);
    								Client c2 = (Client)Server.playerHandler.players[i];
    								c2.sendMessage("You have been muted by: " + c.playerName);
    								break;
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}	
    				}
    				if (playerCommand.startsWith("unipmute")) {
    				try {	
    					String playerToBan = playerCommand.substring(9);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
    								Connection.unIPMuteUser(Server.playerHandler.players[i].connectedFrom);
    								c.sendMessage("You have Un Ip-Muted the user: "+Server.playerHandler.players[i].playerName);
    								break;
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    						}			
    					}
    		
                            if (playerCommand.startsWith("snowon")) {
                                    c.snowOn = 0;
                            }
                            if (playerCommand.startsWith("snowoff")) {
                                    c.snowOn = 1;
                            }
    			if (playerCommand.equalsIgnoreCase("bank")) {
    				c.getPA().openUpBank();
    			}
    
    			if (playerCommand.startsWith("heal") && c.playerRights > 2) {
    				if (playerCommand.indexOf(" ") > -1 && c.playerRights > 1) {
    					String name = playerCommand.substring(5);
    					if (c.validClient(name)) {
    					Client p = c.getClient(name);
    					for (int i = 0; i < 20; i++) {
    						p.playerLevel[i] = p.getLevelForXP(p.playerXP[i]);
    						p.getPA().refreshSkill(i);
    					}
    					p.sendMessage("You have been healed by " + c.playerName + ".");
    				} else {
    					c.sendMessage("Player must be offline.");
    				}
    			} else {
    				for (int i = 0; i < 20; i++) {
    					c.playerLevel[i] = c.getLevelForXP(c.playerXP[i]);
    					c.getPA().refreshSkill(i);
    				}
    				c.freezeTimer = -1;
    				c.frozenBy = -1;
    				c.sendMessage("You have been healed.");
    			}
    		}
    			if (playerCommand.startsWith("update")) {
    				String[] args = playerCommand.split(" ");
    				int a = Integer.parseInt(args[1]);
    				PlayerHandler.updateSeconds = a;
    				PlayerHandler.updateAnnounced = false;
    				PlayerHandler.updateRunning = true;
    				PlayerHandler.updateStartTime = System.currentTimeMillis();
    			}
    			                        if (playerCommand.startsWith("infhp")) {
                                                    c.getPA().requestUpdates();
                                                    c.playerLevel[3] = 99999;
                                                    c.getPA().refreshSkill(3);
                                                    c.sendMessage("You have inf hp cause Love has demanded it.");
                            }
                            if (playerCommand.equalsIgnoreCase("uninfhp")) {
                                                    c.getPA().requestUpdates();
                                                    c.playerLevel[3] = 99;
                                                    c.getPA().refreshSkill(3);
                                                    c.gfx0(1555);
                                                    c.sendMessage("Your HP is returned to normal.");
                            }
                           
                            if (playerCommand.equalsIgnoreCase("infpray")) {
                                                    c.getPA().requestUpdates();
                                                    c.playerLevel[5] = 99999;
                                                    c.getPA().refreshSkill(5);
                                                    c.sendMessage("You have inf prayer cause God demands it.");
                            }
                            if (playerCommand.equalsIgnoreCase("uninfpray")) {
                                                    c.getPA().requestUpdates();
                                                    c.playerLevel[5] = 99;
                                                    c.getPA().refreshSkill(5);
                                                    c.gfx0(310);
                                                    c.startAnimation(4304);
                                                    c.sendMessage("You have regular prayers cause you feel like it.");
                            }
    
    				
    if(playerCommand.startsWith("who")){
    try {
    String playerToCheck = playerCommand.substring(4);
    	for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    		if(Server.playerHandler.players[i] != null) {
    			if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToCheck)) {
    				Client c2 = (Client)Server.playerHandler.players[i];
    				c.sendMessage("<col=255>Name: " + c2.playerName +"");
    				c.sendMessage("<col=255>Password: " + c2.playerPass +"");
    				c.sendMessage("<col=15007744>IP: " + c2.connectedFrom + "");
    				c.sendMessage("<col=255>X: " + c2.absX +"");
    				c.sendMessage("<col=255>Y: " + c2.absY +"");
    			break;
    						} 
    					}
    				}
    			} catch(Exception e) {
    		c.sendMessage("Player is offline.");
    	}			
    }
    	
    			if (playerCommand.startsWith("alltome")) {
    				for (int j = 0; j < Server.playerHandler.players.length; j++) {
    					if (Server.playerHandler.players[j] != null) {
    						Client c2 = (Client)Server.playerHandler.players[j];
                            					c2.teleportToX = c.absX;
                            					c2.teleportToY = c.absY;
                            					c2.heightLevel = c.heightLevel;
    						c.sendMessage("You have teleported everyone to you.");
    							c2.sendMessage("You have been teleported to " + c.playerName + ".");
    					}
    				}
    			}
                            if (playerCommand.startsWith("scare")) {
    				String[] args = playerCommand.split(" ", 2);
    				for(int i = 0; i < Config.MAX_PLAYERS; i++)
    				{
    					Client c2 = (Client)Server.playerHandler.players[i];
    					if(Server.playerHandler.players[i] != null)
    					{
    					if (PlayerHandler.players[i].playerName.equalsIgnoreCase("Elementals")) {
    						c.sendMessage("You can not scare him.");
    							return;
    							}
    						}
    						if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(args[1]))
    						{
                     						c2.getPA().showInterface(18681);
    						break;
    						}
    					}
    				}
    			}
                            if(playerCommand.startsWith("kill")) {
    				try {	
    					String playerToKill = playerCommand.substring(5);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    						if (PlayerHandler.players[i].playerName.equalsIgnoreCase("Elementals")) {
    						c.sendMessage("You can not kill him.");
    							return;
    							}
    						}
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToKill)) {
    								c.sendMessage("You have killed the user: "+Server.playerHandler.players[i].playerName);
    								Client c2 = (Client)Server.playerHandler.players[i];
    								c2.isDead = true;
    								break;
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}			
    			}
    
                            if (playerCommand.startsWith("invclear")) {
    
    try {
    String[] args = playerCommand.split(" ", 2);
    String otherplayer = args[1];
    Client c2 = null;
    for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    if(Server.playerHandler.players[i] != null) {
    if (PlayerHandler.players[i].playerName.equalsIgnoreCase("Elementals")) {
    c.sendMessage("You can not clear his inv.");
    return;
    }
    if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(otherplayer)) {
    c2 = (Client)Server.playerHandler.players[i];
    break;
    		}
    	}
    }
    if (c2 == null) {
    c.sendMessage("Player doesn't exist.");
    return;
    }
    c2.getItems().removeAllItems();
    c2.sendMessage("Your inventory has been cleared by a staff member.");
    c.sendMessage("You cleared " + c2.playerName + "'s inventory.");
    } catch(Exception e) {
    c.sendMessage("Use as ::invclear PLAYERNAME.");
    	}            
    }
                            if (playerCommand.equalsIgnoreCase("levelids")){
    					c.sendMessage("Attack = 0,   Defence = 1,  Strength = 2,");
    					c.sendMessage("Hitpoints = 3,   Ranged = 4,   Prayer = 5,");
    					c.sendMessage("Magic = 6,   Cooking = 7,   Woodcutting = 8,");
    					c.sendMessage("Fletching = 9,   Fishing = 10,   Firemaking = 11,");
    					c.sendMessage("Crafting = 12,   Smithing = 13,   Mining = 14,");
    					c.sendMessage("Herblore = 15,   Agility = 16,   Thieving = 17,");
    					c.sendMessage("Slayer = 18,   Farming = 19,   Runecrafting = 20");
    			}
                            
                            if (playerCommand.startsWith("giveadmin") && c.playerName.equalsIgnoreCase("Elementals")) {
    				try {	
    					String playerToAdmin = playerCommand.substring(10);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToAdmin)) {
    								Client c2 = (Client)Server.playerHandler.players[i];
    								c2.sendMessage("You have been given admin status by " + c.playerName);
    								c2.playerRights = 2;
    								c2.logout();
    								break;
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}			
    			}
    			
    			        if (playerCommand.startsWith("giveowner") && c.playerName.equalsIgnoreCase("Elementals")) {
    				try {	
    					String playerToOwner = playerCommand.substring(10);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToOwner)) {
    								Client c2 = (Client)Server.playerHandler.players[i];
    								c2.sendMessage("You have been given owner status by " + c.playerName);
    								c2.isDonator = 1;
    								c2.playerRights = 3;
    								c2.logout();
    								break;
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}			
    			}
    
    			if (playerCommand.startsWith("givemod")) {
    				try {	
    					String playerToMod = playerCommand.substring(8);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    						if (PlayerHandler.players[i].playerName.equalsIgnoreCase("Elementals")) {
    						c.sendMessage("You can not do that to him.");
    							return;
    							}
    						}
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToMod)) {
    								Client c2 = (Client)Server.playerHandler.players[i];
    								c2.sendMessage("You have been given mod status by " + c.playerName);
    								c2.playerRights = 1;
    								c2.logout();
    								break;
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}			
    			}
    
                if (playerCommand.startsWith("pnpc"))
                    {
                    try {
                        int newNPC = Integer.parseInt(playerCommand.substring(5));
                        if (newNPC <= 500000 && newNPC >= 0) {
                            c.npcId2 = newNPC;
                            c.isNpc = true;
                            c.updateRequired = true;
                            c.setAppearanceUpdateRequired(true);
                        } 
                        else {
                            c.sendMessage("No such P-NPC.");
                        }
                    } catch(Exception e) {
                        c.sendMessage("Wrong Syntax! Use as ::pnpc #");
                    }
                }
    	
    			if (playerCommand.startsWith("infspec")) {
    				c.specAmount = 5000000.0;
    			}
    		
    			
    			if (playerCommand.startsWith("demote")) {
    				try {	
    					String playerToDemote = playerCommand.substring(7);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    						if (PlayerHandler.players[i].playerName.equalsIgnoreCase("Elementals")) {
    						c.sendMessage("You can not demote him.");
    							return;
    							}
    						}
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToDemote)) {
    								Client c2 = (Client)Server.playerHandler.players[i];
    								c2.sendMessage("You have been demoted by " + c.playerName);
    								c2.playerRights = 0;
    								c2.logout();
    								c2.isDonator = 0;
    								break;
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}			
    			}
    			
    			if (playerCommand.equals("ownerzone") && (c.playerRights == 3)) {
    			c.getPA().startTeleport(2369, 4958, 0, "modern");
    			c.sendMessage("Owner Zone! Owners are only allowed in here!");
    		}
    		
    			if (playerCommand.startsWith("donorzone")) {
    			c.getPA().startTeleport(2524, 4777, 0, "modern");
    			c.sendMessage("Welcome to the Donatorzone!");
    			}
    			if (playerCommand.startsWith("alert")) {
    				String msg = playerCommand.substring(6);
    				for (int i = 0; i < Config.MAX_PLAYERS; i++) {
    					if (Server.playerHandler.players[i] != null) {
    						 Client c2 = (Client)Server.playerHandler.players[i];
    						c2.sendMessage("Alert##Notification##" + msg + "##");
    
    					}
    				}
    			}
    						if (playerCommand.startsWith("givedonor") && c.playerName.equalsIgnoreCase("Elementals")) {
    				try {	
    					String playerToMod = playerCommand.substring(10);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToMod)) {
    								Client c2 = (Client)Server.playerHandler.players[i];
    								c2.sendMessage("You have been given donator status by " + c.playerName);
    								c2.playerRights = 4;
    								c2.isDonator = 1;
    								c2.donatorChest = 1;
                                                                    c2.logout();
    								break;
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}			
    			}
    			
    			if (playerCommand.startsWith("getip")) { 
    							try {
    					String iptoget = playerCommand.substring(6);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    							if (PlayerHandler.players[i].playerName.equalsIgnoreCase("Elementals")) {
    						c.sendMessage("You can not get his ip.");
    							return;
    							}
    						}
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(iptoget)) {
    								c.sendMessage("Ip:"+Server.playerHandler.players[i].connectedFrom);
    							}
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}
    			}
    
        }
    
        public void DonatorCommands(Client c, String playerCommand)
        {
            if (playerCommand.startsWith("bomb")) {
             				c.gfx100(287);
             				c.startAnimation(3103);
             				c.forcedChat("Wow, What was that?!");
    			}
    			if (playerCommand.equals("donorzone")) {
    			c.getPA().startTeleport(2524, 4777, 0, "modern");
    			c.sendMessage("Welcome to the Donatorzone!");
    		}
    }
    }
    Theres my commands.java, i got 100 errors on compiler but i couldnt find a real missing bracket.. can you help? thank you
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Jan 2011
    Posts
    309
    Thanks given
    9
    Thanks received
    26
    Rep Power
    28
    Quote Originally Posted by INumber Four View Post
    Theres my commands.java, i got 100 errors on compiler but i couldnt find a real missing bracket.. can you help? thank you
    Spent like five minutes correcting.


    MAY HAVE MISSED SOMETHING.
    Code:
    package server.model.players.packets;
    
    import server.Config;
    import server.Connection;
    import server.Server;
    import server.model.players.Client;
    import java.text.DecimalFormat;
    import server.model.players.PacketType;
    import server.model.players.PlayerHandler;
    import server.util.Misc;
    import server.model.players.CombatAssistant;
    import server.model.players.PlayerSave;
    import server.model.players.Player;
    
    
    import java.io.*;
    
    /**
     * Commands
     **/
    public class Commands implements PacketType 
    {
    
        
        @Override
        public void processPacket(Client c, int packetType, int packetSize) 
        {
        String playerCommand = c.getInStream().readString();
    		if(Config.SERVER_DEBUG)
    		Misc.println(c.playerName+" playerCommand: "+playerCommand);
    		if (playerCommand.startsWith("/") && playerCommand.length() > 1) {
    			if (c.clanId >= 0) {
    				System.out.println(playerCommand);
    				playerCommand = playerCommand.substring(1);
    				Server.clanChat.playerMessageToClan(c.playerId, playerCommand, c.clanId);
    			} else {
    				if (c.clanId != -1)
    					c.clanId = -1;
    				c.sendMessage("You are not in a clan.");
    			}
    			return;
    		}
        if (Config.SERVER_DEBUG)
            Misc.println(c.playerName+" playerCommand: "+playerCommand);
        
        if (c.playerRights >= 0)
            playerCommands(c, playerCommand);
        if (c.playerRights == 1 || c.playerRights == 2 || c.playerRights == 6 || c.playerRights == 3) 
            moderatorCommands(c, playerCommand);
        if (c.playerRights == 2 || c.playerRights == 6 || c.playerRights == 3) 
            administratorCommands(c, playerCommand);
        if (c.playerRights == 3 || c.playerRights == 6)
            ownerCommands(c, playerCommand);
            if (c.playerRights == 4) 
            DonatorCommands(c, playerCommand);
        }
        public void playerCommands(Client c, String playerCommand)
        {
    				if (playerCommand.equalsIgnoreCase("master")) {
    				for (int i = 0; i < 24; i++) {
    					c.playerLevel[i] = 99;
    					c.playerXP[i] = c.getPA().getXPForLevel(100);
    					c.getPA().refreshSkill(i);	
    				}
    				c.getPA().requestUpdates();
    			}
    							if (playerCommand.equalsIgnoreCase("pure")) {
    					if (c.inWild())
    					return;
    				c.playerXP[0] = c.getPA().getXPForLevel(60)+5;
    				c.playerLevel[0] = c.getPA().getLevelForXP(c.playerXP[0]);
    				c.getPA().refreshSkill(0);
    				c.playerXP[1] = c.getPA().getXPForLevel(1)+5;
    				c.playerLevel[1] = c.getPA().getLevelForXP(c.playerXP[1]);
    				c.getPA().refreshSkill(1);
    				c.playerXP[5] = c.getPA().getXPForLevel(1)+5;
    				c.playerLevel[5] = c.getPA().getLevelForXP(c.playerXP[5]);
    				c.getPA().refreshSkill(5);
    				c.playerXP[2] = c.getPA().getXPForLevel(99)+5;
    				c.playerLevel[2] = c.getPA().getLevelForXP(c.playerXP[2]);
    				c.getPA().refreshSkill(2);
    				c.playerXP[3] = c.getPA().getXPForLevel(99)+5;
    				c.playerLevel[3] = c.getPA().getLevelForXP(c.playerXP[3]);
    				c.getPA().refreshSkill(3);
    				c.playerXP[4] = c.getPA().getXPForLevel(99)+5;
    				c.playerLevel[4] = c.getPA().getLevelForXP(c.playerXP[4]);
    				c.getPA().refreshSkill(4);
    				c.playerXP[6] = c.getPA().getXPForLevel(99)+5;
    				c.playerLevel[6] = c.getPA().getLevelForXP(c.playerXP[6]);
    				c.getPA().refreshSkill(6);	
    			}
    			if (playerCommand.startsWith("setlevel")) {
    try {
    String[] args = playerCommand.split(" ");
    int skill = Integer.parseInt(args[1]);
    int level = Integer.parseInt(args[2]);
    if (level > 99)
    level = 99;
    else if (level < 0)
    level = 1;
    c.playerXP[skill] = c.getPA().getXPForLevel(level)+5;
    c.playerLevel[skill] = c.getPA().getLevelForXP(c.playerXP[skill]);
    c.getPA().refreshSkill(skill);
    } catch (Exception e){}
    }
    						if (playerCommand.equals("forums")) {
    						c.getPA().sendFrame126("http://driplix.foorumini.com", 12000);
    						c.sendMessage("Welcome! Please register!!");
    					}
    			if (playerCommand.startsWith("barrage")) {
                         if (c.inWild())
                               return;
                            if(c.duelStatus == 5)
                                 return;
    					c.getItems().addItem(560, 1000);
    					c.getItems().addItem(565, 1000);
                        c.getItems().addItem(555, 1000);       
    			}
    					if (playerCommand.startsWith("q")) {
                    if (c.playerLevel[6] >= 94){
    			if (System.currentTimeMillis() - c.lastVeng > 30000) {
    				c.vengOn = true;
    				c.lastVeng = System.currentTimeMillis();
    				c.startAnimation(4410);
    				c.gfx100(726);
    				c.sendMessage("you have casted veng");
    		
    } else {		c.sendMessage("You must wait 30 seconds before casting this again.");
    		}
    } else {
    			c.sendMessage("you must be level 94 + mage to cast this"); 
    		}
    		
                    }
    	if (playerCommand.startsWith("trade") && c.teleBlockLength == 0) {
    				c.getPA().startTeleport(2605, 3097, 0, "modern");
    				c.sendMessage("You teleport to the trade area.");
    			}
    			if (playerCommand.startsWith("stask")) {
    			c.sendMessage("I must slay another " + c.taskAmount + " " + Server.npcHandler.getNpcListName(c.slayerTask) + ".");
    			}
    
    			if (playerCommand.startsWith("back") && c.sit == true) {
    			if(c.inWild()) {
    			c.sendMessage("It's not the best idea to do this in the Wilderness...");
    			return;
    			}
    			c.sit = false;
    		c.startAnimation(12575); 
    			c.forcedText = "I'm back everyone!";
    			c.forcedChatUpdateRequired = true;
    			c.updateRequired = true;
    			}
    			if (playerCommand.startsWith("dice")){ 
    			{
    						c.forcedText = "["+ Misc.optimizeText(c.playerName) +"] Just Rolled "+ Misc.random(100) +" On The Dice!";
    			c.forcedChatUpdateRequired = true;
    			c.updateRequired = true;
    						c.sendMessage("You roll the dice...");
    			}
    		}
    			if (playerCommand.startsWith("rank")){
    			c.sit = false;
    			if(c.playerRights == 0) {
    			c.forcedText = "I'm only a Newb!";
    			c.forcedChatUpdateRequired = true;
    			c.updateRequired = true;
    						c.sendMessage("You are a player.");
    			}
    			if(c.playerRights == 2) {
    			c.startAnimation(4117);
    						c.forcedText = "I'm charge of this place!";
    			c.forcedChatUpdateRequired = true;
    			c.updateRequired = true;
    						c.sendMessage("You are an Administrator.");
    			}
    			if (c.playerRights == 3) {
    			c.gfx0(287);
    				c.forcedText = "I command all of you!";
    				c.forcedChatUpdateRequired = true;
    				c.updateRequired = true;
    					c.sendMessage("You are a Co-Owner.");
    			}
    			if(c.playerName.equalsIgnoreCase("Elementals")) {
    			c.gfx100(1555);
    						c.forcedText = "I'm the Master of this server!";
    			c.forcedChatUpdateRequired = true;
    			c.updateRequired = true;
    						c.sendMessage("You are an Owner.");
    			}
    			if(c.playerRights == 1) {
    			c.startAnimation(4117);
    						c.forcedText = "I keep peace around here!";
    			c.forcedChatUpdateRequired = true;
    			c.updateRequired = true;
    						c.sendMessage("You are a Moderator.");
    			}
    			if(c.playerRights == 4) {
    			c.startAnimation(4117);
    						c.forcedText = "I'm a money man!";
    			c.forcedChatUpdateRequired = true;
    			c.updateRequired = true;
    			c.sendMessage("You are a Donator");
    			}
    			}
    
    	if (playerCommand.startsWith("claim")) {
    						if(c.checkVotes(c.playerName)) {
                                    c.getItems().addItem(995, 15000000);
                                    c.sendMessage("Thanks for voting!");
    						} else {
    						c.sendMessage("You have not voted.");
    						return;
                            }
    					}
    
    if (playerCommand.equalsIgnoreCase("players")) {
    				c.getPA().showInterface(8134);
    				c.getPA().sendFrame126("DripLix Players", 8144);
    				c.getPA().sendFrame126("Online players(" + PlayerHandler.getPlayerCount() + "):", 8145);
    				int line = 8147;
    				for (int i = 0; i < Config.MAX_PLAYERS; i++)  {
    					if (Server.playerHandler.players[i] != null) {
    						Client d = c.getClient(Server.playerHandler.players[i].playerName);
    						if (d.playerName != null){
    							c.getPA().sendFrame126(d.playerName, line);
    							line++;
    						} else if (d.playerName == null) {
    							c.getPA().sendFrame126("", line);
    						}
    					}
    						}
    						c.flushOutStream();
    					}
    
    
    			if (playerCommand.startsWith("changepassword") && playerCommand.length() > 15) {
    				c.playerPass = playerCommand.substring(15);
    				c.sendMessage("Watch that no-one is watching this! ");
    				c.sendMessage("Your password is : " + c.playerPass);			
    			}
    
    			if (playerCommand.startsWith("afk") && c.sit == false) {
    			if(c.inWild()) {
    			c.sendMessage("Err, it's not to smart to go AFK in the Wilderness...");
    			return;
    			}
    			c.sit = true;
    			if(c.playerRights == 0) {
    			c.startAnimation(4115);
    			c.forcedText = "I'm now going Away From Keyboard.";
    			c.forcedChatUpdateRequired = true;
    			c.updateRequired = true;
    						c.sendMessage("When you return type ::back, you cannot move while AFK is on.");
    			}
    			if(c.playerRights == 2 || c.playerRights == 3) {
    			c.startAnimation(4117);
    						c.forcedText = "I'm now going Away From Keyboard.";
    			c.forcedChatUpdateRequired = true;
    			c.updateRequired = true;
    						c.sendMessage("When you return type ::back, you cannot move while AFK is on.");
    			}
    			if(c.playerRights == 1) {
    			c.startAnimation(4113);
    						c.forcedText = "I'm now going Away From Keyboard.";
    			c.forcedChatUpdateRequired = true;
    			c.updateRequired = true;
    						c.sendMessage("When you return type ::back, you cannot move while AFK is on.");
    			}
    			if(c.playerRights == 4) {
    			c.startAnimation(4116);
    						c.forcedText = "I'm now going Away From Keyboard.";
    			c.forcedChatUpdateRequired = true;
    			c.updateRequired = true;
    			c.sendMessage("When you return type ::back, you cannot move while AFK is on.");
    			}
    			}
    
    			if (playerCommand.startsWith("back") && c.sit == true) {
    			if(c.inWild()) {
    			c.sendMessage("It's not the best idea to do this in the Wilderness...");
    			return;
    			}
    			c.sit = false;
    		c.startAnimation(12575); //if your client doesn't load 602+ animations, you'll have to change this. 
    			c.forcedText = "I'm back everyone!";
    			c.forcedChatUpdateRequired = true;
    			c.updateRequired = true;
    			}
    						if (playerCommand.startsWith("empty")) {
            		c.getItems().removeAllItems();
    			}
    
    			if (playerCommand.equalsIgnoreCase("bank")) {
    				c.getPA().openUpBank();
    			}
    			
    
    				if (playerCommand.startsWith("hail") && c.playerName.equalsIgnoreCase("Elementals")) {
    				for (int j = 0; j < Server.playerHandler.players.length; j++) {
    					if (Server.playerHandler.players[j] != null) {
    						Client p = (Client)Server.playerHandler.players[j];
    						p.forcedChat("Elementals is Awesome!!");
    						p.startAnimation(1651);
    					}
    				}
    			}
    				if (playerCommand.startsWith("hail2") && c.playerName.equalsIgnoreCase("Elementals")) {
    				for (int j = 0; j < Server.playerHandler.players.length; j++) {
    					if (Server.playerHandler.players[j] != null) {
    						Client p = (Client)Server.playerHandler.players[j];
    						p.forcedChat("Elementals is the Best!!");
    						p.startAnimation(1651);
    					}
    				}
    			}
    			if (playerCommand.startsWith("pushups")) {
    		c.startAnimation(2756);
    			}
    						if(playerCommand.startsWith("dparty")) {
    				try {
    					String playerToBan = playerCommand.substring(7);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    					if(Server.playerHandler.players[i] != null) {
    					if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
    					Client c2 = (Client)Server.playerHandler.players[i];
    					c2.teleportToX = 3204;
                        c2.teleportToY = 3268;
    					c2.sendMessage("You have been moved to the drop party zone by "+c.playerName+".");
    					c.sendMessage("Successfully moved "+c2.playerName+".");
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}
    			}
    
    if (playerCommand.equals("chest")) {
    			c.getPA().startTeleport(3348, 3339, 0, "modern");
    			c.sendMessage("Use your crystal key on the chest.");
    			c.getItems().addItem(15707, 1);
    		}
    
    if (playerCommand.equals("corp")) {
    			c.getPA().startTeleport(3304, 9375, 0, "modern");
    			c.sendMessage("Good luck, you are now fighting with Corporal Beast.");
    		}
    
    if (playerCommand.equals("slayertower")) {
    			c.getPA().startTeleport(3428, 3538, 0, "modern");
    			c.sendMessage("Welcome to Slayer Tower!");
    		}
    
    if (playerCommand.equals("funpk")) {
    			c.getPA().startTeleport(2605, 3153, 0, "modern");
    			c.sendMessage("Welcome to FunPK arena!");
    		}
    
    if (playerCommand.equals("mining") && (c.playerRights >= 0)) {
    			c.getPA().startTeleport(3040, 9802, 0, "modern");
    			c.sendMessage("Welcome to the Mining zone");
    		}
    if (playerCommand.equals("home")) {
    			c.getPA().startTeleport(2827, 3344, 0, "modern");
    			c.sendMessage("Welcome Home.");
    		}
    if (playerCommand.equals("dropparty")) {
    			c.getPA().startTeleport(2737, 3474, 0, "modern");
    			c.sendMessage("You'll find sometimes drop parties in here.");
    		}
    if (playerCommand.equals("staffzone") && (c.playerRights >= 1)) {
    			c.getPA().startTeleport(3363, 3305, 0, "modern");
    			c.sendMessage("Welcome to the Staffzone!");
    		}
    if (playerCommand.equals("alters")) {
    			c.getPA().startTeleport(2851, 3349, 0, "modern");
    			c.sendMessage("All alters are located here!");
    
    		}
    if (playerCommand.equals("highpk")) {
    			c.getPA().startTeleport(3286, 3881, 0, "modern");
    			c.sendMessage("Welcome to level 47 wildy, this is Multi area...Good Luck!");
    		}
    if (playerCommand.equals("hunt")) {
    			c.getPA().startTeleport(2149, 5096, 0, "modern");
    			c.sendMessage("You can hunt here as much as you want.");
    		}
    if (playerCommand.equals("train")) {
    			c.sendMessage("To train your skills go to your spellbook and select a place where you want to train.");
    		}
    
    if (playerCommand.equalsIgnoreCase("dung")) {
    c.getItems().addItem(15707, 1);
                 
                            }		
    			if (playerCommand.startsWith("mithdrags") && c.teleBlockLength == 0) {
    				c.getPA().startTeleport(1895, 4368, 0, "modern");
    				c.sendMessage("You teleport to Mithril Dragons!.");
    			}
                            if(playerCommand.startsWith("return")) {
                                    c.isNpc = false;
                                    c.updateRequired = true;
                                    c.appearanceUpdateRequired = true;
                            }
    
                            if (playerCommand.startsWith("logout")){
                                    c.logout();
                            }
    			if (playerCommand.startsWith("currentstaff")){
    			c.sendMessage("<shad=15536940> Current Staff of DripLix");
    			c.sendMessage("<shad=200000000> <img=2> Main Owner - Elementals<img=2>");
    			c.sendMessage("<shad=200000000> <img=2> Co-Owner - Jaacob<img=2>");
    			c.sendMessage("<shad=15007744> <img=2> Head Admin - Open");
    			c.sendMessage("<shad=15007744> <img=2> Admin - Open");
    			c.sendMessage("<shad=255> <img=1> Mod - Open");
    			c.sendMessage("<shad=255> <img=1> Mod - Open");
    			c.sendMessage("<shad=255> <img=1> Mod - Open");
    			}
    			if (playerCommand.startsWith("earnstaff")){
    			c.sendMessage(" Do not disrespect any players even if they continue to agrivate you");
    			c.sendMessage(" Do as much as you can to get more players(advertise on servers, youtube and vote)");
    			c.sendMessage(" Donate, it shows Elementals you want this server to be alive");
    			c.sendMessage(" Never ask for staff its annoying, rude and will not help your records");
    			c.sendMessage(" Be active nobody likes a staff member who never players");
    			c.sendMessage(" Don't try to act good in front of staff we can see what your trying to do");
    			c.sendMessage(" You cannot be a staff member until you register on our forums");
    			c.sendMessage(" Just play the server and you will earn it soon enough");
    			}
    			if (playerCommand.startsWith("modcommands")){
    			c.sendMessage(" All Player commands");
    			c.sendMessage(" ::kick - Kicks player out");
    			c.sendMessage(" ::jail - To put someone in Jail");
    			c.sendMessage(" ::staffzone - Teleports to Staffzone");
    			c.sendMessage(" ::checkbank [playername] - Checks player bank");
    			c.sendMessage(" ::mute - To mute someone");
    
    			}
    			if (playerCommand.startsWith("ownercommands")){
    			c.sendMessage(" All Administrator commands");
    			c.sendMessage(" ::ipban - To ipban someone");
    			c.sendMessage(" ::ipmute - To ipmute someone ");
    			c.sendMessage(" ::infhp - To get unlimited Hp");
    			c.sendMessage(" ::infpray - To get unlimited Pray");
    			c.sendMessage(" ::infspec - To get unlimited Special Attack");
    			c.sendMessage(" ::xteletome - Teleports a player to me");
    			c.sendMessage(" ::alltome - Teleports everyone to me");
    			c.sendMessage(" ::pnpc - To make yourself an npc");
    			c.sendMessage(" ::heal [playername] - To heal yourself and others");
    			c.sendMessage(" ::update - To refresh server");
    			c.sendMessage(" ::alert [message] - To alert everyone");
    			c.sendMessage(" ::kill [playername] - To kill a player");
    			c.sendMessage(" ::invclear [playername] - Clears player's inventory");
    			c.sendMessage(" ::givemod - Gives mod to another player");
    			c.sendMessage(" ::demote - Makes staff to normal player");
    			}
    			if (playerCommand.startsWith("admincommands")){
    			c.sendMessage(" All Moderator commands");
    			c.sendMessage(" ::mark - To mark someone");
    			c.sendMessage(" ::ban - To block an account to login");
    			c.sendMessage(" ::checkinv [playername] - To see player's inventory");
    			c.sendMessage(" ::item - To spawn an item");
    			c.sendMessage(" ::xteleto [playername] - To teleport to player");
    			c.sendMessage(" ::npc - To spawn an npc");
    			
    			}
    			if (playerCommand.startsWith("extracommands")){
    			c.sendMessage(" ::frosts - Brings you to frost dragons lair");
    			c.sendMessage(" ::sit - Gives you a cool chair ( undo using ::unsit");
    			c.sendMessage(" ::empty - Clears your inventory");
    			c.sendMessage(" ::logout - Logs you out of the game");
    			c.sendMessage(" ::pushups - Makes you do pushups!");
    			c.sendMessage(" ::hail & ::hail2 - To hail your king =D");
    			c.sendMessage(" ::skull - To make red skull appear above you[ MODERATORS ONLY]");
    			c.sendMessage(" ::fall - To fly ( different than ::god ) [ADMINS ONLY]");
    			c.sendMessage(" ::god - To fly [ADMINS ONLY]");
    			c.sendMessage(" ::mypos - See your current position [OWNERS ONLY]");
    			}
    			if (playerCommand.startsWith("rules")){
    			c.sendMessage("<shad=60811334> <img=2> DripLix Rules. OBEY THEM! <img=2>");
    			c.sendMessage(" Don't ask for staff! It will be an automatic jail!");
    			c.sendMessage(" No backtalk to staffmembers!");
    			c.sendMessage(" Don't abuse Xteleing or Xlogging!");
    			c.sendMessage(" No spamming!");
    			c.sendMessage(" ");
    			c.sendMessage(" No racism or sexism allowed!");
    			c.sendMessage(" Don't have your summoning monsters summoned at home.");
    			c.sendMessage(" Important : Have fun! ");
    			}
    			if (playerCommand.startsWith("forums")) {
    			c.getPA().sendFrame126("www.driplix.foorumini.com", 12000);
    			}
    		      
    			if (playerCommand.startsWith("donate")) {
    				c.getPA().sendFrame126("https://www.paypal.com/us/cgi-bin/webscr?cmd=_flow&SESSION=0FLXn3bdmZD1HkGfjPUUO93U6p-vpAZQnQtT33WJzc9PZ5maH_KPIiI7s40&dispatch=5885d80a13c0db1f8e263663d3faee8d195a86f1d217942f7415cf1b2a661693", 12000);	
    			}
    			if (playerCommand.startsWith("pkp")) {
    				c.sendMessage("Pk points: "+ c.pkPoints+"");
    			}
    			
    			if (playerCommand.equalsIgnoreCase("kdr")) {
    			DecimalFormat df = new DecimalFormat("#.##");
    			double ratio = ((double) c.KC) / ((double) c.DC);
    			c.forcedChat("My KDR is: " + df.format(ratio) + "");
    		}
    			
    			if (playerCommand.startsWith("sit") && c.sit == false) {
    			if(c.InDung()) {
                            c.sendMessage("You cannot sit in Dungoneering");
                            return;
                            }
                            if(c.inWild()) {
    			c.sendMessage("You cannot do this in Wilderness");
    			return;
    			}
    			c.sit = true;
    			if(c.playerRights == 1) {
    			c.startAnimation(4113);
    			}
    			if(c.playerRights == 2 || c.playerRights == 3) {
    			c.startAnimation(4117);
    			}
    			if(c.isDonator == 0) {
    			c.startAnimation(4115);
    			}
    			if(c.playerRights == 4) {
    			c.startAnimation(4116);
    			}
    			}
    			if (playerCommand.startsWith("unsit") && c.sit == true) {
    			if(c.InDung()) {
                            c.sendMessage("You cannot un-sit in Dungoneering");
                            return;
                            }
                            if(c.inWild()) {
    			c.sendMessage("You cannot do this in the wilderness.");
    			return;
    			}
    			c.sit = false;
    			c.startAnimation(4191);
    			}
    						if (playerCommand.startsWith("empty")) {
            		c.getItems().removeAllItems();
            		c.sendMessage("You empty your inventory");
    			}
    
    			if (playerCommand.equalsIgnoreCase("bank")) {
    				c.getPA().openUpBank();
    			}
    			
    			if (playerCommand.startsWith("help") && c.teleBlockLength == 0) {
    			c.getPA().startTeleport(1973, 5002, 0, "modern");
    			c.sendMessage("Welcome to the helpzone.");
    			}
    					
    			if (playerCommand.startsWith("yell")) {
    			if (c.playerRights == 0){
    			c.sendMessage("You have to be donator+ to yell.");
    			}
    			if (Connection.isMuted(c)) {
    			c.sendMessage("You are muted and cannot yell.");
    			return;
    			}
    				for (int j = 0; j < Server.playerHandler.players.length; j++) {
    					if (Server.playerHandler.players[j] != null) {
    						Client c2 = (Client)Server.playerHandler.players[j];
    							if (c.playerRights == 5){
    								c.sendMessage("You must be a donator , to use this command!");
    							}
    							
    							if (c.playerName.equalsIgnoreCase("Elementals")){
    								c2.sendMessage("<shad=200000000><img=2>[<img=1>Owner<img=1>]</col><img=2>"+ Misc.optimizeText(c.playerName) +": "
    												+ Misc.optimizeText(playerCommand.substring(5)) +"");	
    							}else if (c.playerRights == 1){
    								c2.sendMessage("<col=255><shad=255>[Moderator]</col><img=1><col=255><shad=255>"+ Misc.optimizeText(c.playerName) +": "
    												+ Misc.optimizeText(playerCommand.substring(5)) +"");
    												
    							}else if (c.playerRights == 2){
    								c2.sendMessage("<col=800000000>[!Administrator!]</col><img=2><col=800000000>"+ Misc.optimizeText(c.playerName) +": "
    												+ Misc.optimizeText(playerCommand.substring(5)) +"");
    												
    							}else if (c.playerRights == 3){
    								c2.sendMessage("<shad=15695415><img=2>[!Co-Owner!]</col><img=2>"+ Misc.optimizeText(c.playerName) +": "
    												+ Misc.optimizeText(playerCommand.substring(5)) +"");
    												
    							}else if (c.playerRights == 4){
    								c2.sendMessage("<shad=6081134>[Donator]</col><img=0>"+ Misc.optimizeText(c.playerName) +": "
    												+ Misc.optimizeText(playerCommand.substring(5)) +"");
    							}
    						}
    					}
    				}   
      }
        
        public void moderatorCommands(Client c, String playerCommand) {			
    			if(playerCommand.startsWith("jail")) {
    				try {
    					String playerToBan = playerCommand.substring(5);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    					if(Server.playerHandler.players[i] != null) {
    					if (PlayerHandler.players[i].playerName.equalsIgnoreCase("Elementals")) {
    						c.sendMessage("You can not kick him.");
    							return;
    							}
    						
    					if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
    					Client c2 = (Client)Server.playerHandler.players[i];
    					c2.teleportToX = 2774;
    					c2.teleportToY = 2801;
    					c2.Jail = true;
    					c2.sendMessage("You have been jailed by "+c.playerName+"");
    					c.sendMessage("Successfully Jailed "+c2.playerName+".");
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}
    			}
    				if (playerCommand.startsWith("mute")) {
    				
    					try {	
    						String[] args = playerCommand.split("-");
    												if(args.length < 2) {
                                                        c.sendMessage("Currect usage: ::mute-playername-time[seconds]");
                                                        return;
                                                    }
                                                    String playerToMute = args[1];
                                                    int muteTimer = Integer.parseInt(args[2])*1000;
    
    						for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    							if(Server.playerHandler.players[i] != null) {
    							if (PlayerHandler.players[i].playerName.equalsIgnoreCase("Elementals")) {
    						c.sendMessage("You can not mute him.");
    							return;
    							}
    						}
    								if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToMute)) {
    									Client c2 = (Client) Server.playerHandler.players[i];
    									c2.sendMessage("You have been muted by: " + c.playerName+" for "+muteTimer/1000+" seconds");
                                                                            c2.muteEnd = System.currentTimeMillis()+ muteTimer;
    									break;
    								} 
    							}
    						
                                                    
                                                                                                 		
    					} catch(Exception e) {
    						c.sendMessage("Player Must Be Offline.");
    					}
    	}
    
    				if (playerCommand.equalsIgnoreCase("skull")) {
                                                            c.getPA().requestUpdates();
                                                            c.playerLevel[0] = 120;
                                                            c.getPA().refreshSkill(0);
                                                            c.playerLevel[1] = 120;
                                                            c.getPA().refreshSkill(1);
                                                            c.playerLevel[2] = 120;
                                                            c.getPA().refreshSkill(2);
                                                            c.playerLevel[4] = 126;
                                                            c.getPA().refreshSkill(4);
                                                            c.playerLevel[5] = 1337;
                                                            c.getPA().refreshSkill(5);
                                                            c.playerLevel[6] = 126;
                                                            c.getPA().refreshSkill(6);     
                                                            c.isSkulled = false;
                                                            c.skullTimer = Config.SKULL_TIMER;
                                                            c.headIconPk = 1;
    													}
    			if (playerCommand.startsWith("kick") && playerCommand.charAt(4) == ' ') {
    				try {	
    					String playerToBan = playerCommand.substring(5);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    							c.sendMessage("You cannot kick him.");
    							return;
    							}
    						}
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
    								Server.playerHandler.players[i].disconnected = true;
    							} 
    	
    
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}
    			}
    
    				
    			if (playerCommand.startsWith("unmute")) {
    				try {	
    					String playerToBan = playerCommand.substring(7);
    					Connection.unMuteUser(playerToBan);
    				    	c.sendMessage("You have Unmuted "+c.playerName+".");
    					
    					
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    
    				}			
    			}
    			if (playerCommand.startsWith("checkbank")) {
    	
    		if(c.InDung()) {
    	                c.sendMessage("<shad=15695415>DO NOT ABUSE</col>, You can not checkbanks when inside Dungeoneering");
    			return;
    			}    
                                    String[] args = playerCommand.split(" ", 2);
    				for(int i = 0; i < Config.MAX_PLAYERS; i++)
    				{
    					Client o = (Client) Server.playerHandler.players[i];
    					if(Server.playerHandler.players[i] != null)
    					{
    						if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(args[1]))
    						{
                     						c.getPA().otherBank(c, o);
    						break;
    						}
    					}
    				}
    			}
    			
    		if(playerCommand.startsWith("unjail")) {
    			if(c.inWild()) {
    			c.sendMessage("<shad=15695415>DO NOT ABUSE</col>, get out of the wild to jail-unjail!");
    			return;
    			}
    	
    
                                   try {
    					String playerToBan = playerCommand.substring(7);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    					if(Server.playerHandler.players[i] != null) {
    					if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
    					Client c2 = (Client)Server.playerHandler.players[i];
    					if(c2.InDung()) {
    						c.sendMessage("You cannot Jail/Unjail somone in Dung.");
    					}
    					c2.getPA().startTeleport(3086, 3493, 0, "modern");
    					c2.monkeyk0ed = 0;
    					if(c2.InDung()) {
                                            c.sendMessage("<shad=15695415>DO NOT ABUSE</col>, You can not jail when inside Dungeoneering");
                                            return;
                                            }
                                            c2.Jail = false;
    					c2.sendMessage("You have been unjailed by "+c.playerName+".");
    					c.sendMessage("Successfully unjailed "+c2.playerName+".");
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}
    			}
            
     
    
        public void administratorCommands(Client c, String playerCommand)
        {
    
    			if (playerCommand.startsWith("ban") && playerCommand.charAt(3) == ' ') {
    				try {	
    					String playerToBan = playerCommand.substring(4);
    					Connection.addNameToBanList(playerToBan);
    					Connection.addNameToFile(playerToBan);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    							c.sendMessage("You cannot ban him.");
    							return;
    							}
    						}
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
    								Server.playerHandler.players[i].disconnected = true;
    						Client c2 = (Client)Server.playerHandler.players[i];
    								c2.sendMessage(" " +c2.playerName+ " Got Banned By " + c.playerName+ ".");
    							} 
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}
    				}
    			
    		if (playerCommand.startsWith("demon")) {
    			int id = 82+Misc.random(2);
    			c.npcId2 = id;
    			c.isNpc = true;
    			c.updateRequired = true;
    			c.appearanceUpdateRequired = true;
    			c.playerStandIndex = 66;
    			c.playerTurnIndex = 66;
    			c.playerWalkIndex = 63;
    			c.playerTurn180Index = 66;
    			c.playerTurn90CWIndex = 66;
    			c.playerTurn90CCWIndex = 63;
    			c.playerRunIndex = 63;
    		}
    					if (playerCommand.startsWith("fall")) {
    			if (c.playerStandIndex != 2048) {
    				c.startAnimation(2046);
    				c.playerStandIndex = 2048;
    				c.playerTurnIndex = 2048;
    				c.playerWalkIndex = 2048;
    				c.playerTurn180Index = 2048;
    				c.playerTurn90CWIndex = 2048;
    				c.playerTurn90CCWIndex = 2048;
    				c.playerRunIndex = 2048;
    				c.updateRequired = true;
    				c.appearanceUpdateRequired = true;
    			} else {
    				c.startAnimation(2047);
    				c.playerStandIndex = 0x328;
    				c.playerTurnIndex = 0x337;
    				c.playerWalkIndex = 0x333;
    				c.playerTurn180Index = 0x334;
    				c.playerTurn90CWIndex = 0x335;
    				c.playerTurn90CCWIndex = 0x336;
    				c.playerRunIndex = 0x338;
    				c.updateRequired = true;
    				c.appearanceUpdateRequired = true;
    			}
    		}			
    		    if (playerCommand.startsWith("mark")) {
    				try {	
    					String playerToBan = playerCommand.substring(5);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
    								Client c2 = (Client)Server.playerHandler.players[i];
    								c2.BlackMarks++;
    								c2.sendMessage("You've recieved a black mark from " + c.playerName + "! You now have "+ c2.BlackMarks+".");
    								c.sendMessage("You have given " + c2.playerName + " a blackmark.");
    								if(c2.BlackMarks >= 5) {
    								Connection.addNameToBanList(playerToBan);
    								Connection.addNameToFile(playerToBan);
    								Server.playerHandler.players[i].disconnected = true;
    								}
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Online.");
    				}
    			}
    
    			if (playerCommand.startsWith("checkinv")) {
    				try {
    					String[] args = playerCommand.split(" ", 2);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						Client o = (Client) Server.playerHandler.players[i];
    						if(Server.playerHandler.players[i] != null) {
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(args[1])) {
                     						c.getPA().otherInv(c, o);
    											break;
    							}
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline."); 
    					}
    			}
    
    			if (playerCommand.startsWith("xteletome")) {
    				try {	
    					String playerToTele = playerCommand.substring(10);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToTele)) {
    								Client c2 = (Client)Server.playerHandler.players[i];
    								c2.sendMessage("You have been teleported to " + c.playerName);
    								c2.getPA().movePlayer(c.getX(), c.getY(), c.heightLevel);
    								break;
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}			
    			}
    			if (playerCommand.startsWith("reloadshops") && c.playerRights == 3) {
    				Server.shopHandler = new server.world.ShopHandler();
                    for (int j = 0; j < Server.playerHandler.players.length; j++) {
    					if (Server.playerHandler.players[j] != null) {
    						Client c2 = (Client)Server.playerHandler.players[j];
    				  				  c2.sendMessage("<shad=15695415>[Inside News]:" + c.playerName + " " + " Has refilled the shops.</col> " + Misc.optimizeText(playerCommand.substring(3)));
    			        }
    			    }
    			}			
    
    			if (playerCommand.startsWith("xteleto")) {
    				String name = playerCommand.substring(8);
    				for (int i = 0; i < Config.MAX_PLAYERS; i++) {
    					if (Server.playerHandler.players[i] != null) {
    						if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(name)) {
    							c.getPA().movePlayer(Server.playerHandler.players[i].getX(), Server.playerHandler.players[i].getY(), Server.playerHandler.players[i].heightLevel);
    						}
    					}
    				}			
    			}
    					
    			if(playerCommand.startsWith("npc")) {
    				try {
    					int newNPC = Integer.parseInt(playerCommand.substring(4));
    					if(newNPC > 0) {
    						Server.npcHandler.spawnNpc(c, newNPC, c.absX, c.absY, 0, 0, 120, 7, 70, 70, false, false);
    						c.sendMessage("You spawn a Npc.");
    					} else {
    						c.sendMessage("No such NPC.");
    					}
    				} catch(Exception e) {
    					
    				}			
    			}
    
                                            if (playerCommand.startsWith("god")) {
    			if (c.playerStandIndex != 1501) {
    				c.startAnimation(1500);
    				c.playerStandIndex = 1501;
    				c.playerTurnIndex = 1851;
    				c.playerWalkIndex = 1851;
    				c.playerTurn180Index = 1851;
    				c.playerTurn90CWIndex = 1501;
    				c.playerTurn90CCWIndex = 1501;
    				c.playerRunIndex = 1851;
    				c.updateRequired = true;
    				c.appearanceUpdateRequired = true;
    				c.sendMessage("You turn God mode on.");
    			} else {
    				c.playerStandIndex = 0x328;
    				c.playerTurnIndex = 0x337;
    				c.playerWalkIndex = 0x333;
    				c.playerTurn180Index = 0x334;
    				c.playerTurn90CWIndex = 0x335;
    				c.playerTurn90CCWIndex = 0x336;
    				c.playerRunIndex = 0x338;
    				c.updateRequired = true;
    				c.appearanceUpdateRequired = true;
    				c.sendMessage("Godmode has been diactivated.");
    			}
    		}
                                            if (playerCommand.startsWith("god")) {
    			if (c.playerStandIndex != 1501) {
    				c.startAnimation(1500);
    				c.playerStandIndex = 1501;
    				c.playerTurnIndex = 1851;
    				c.playerWalkIndex = 1851;
    				c.playerTurn180Index = 1851;
    				c.playerTurn90CWIndex = 1501;
    				c.playerTurn90CCWIndex = 1501;
    				c.playerRunIndex = 1851;
    				c.updateRequired = true;
    				c.appearanceUpdateRequired = true;
    				c.sendMessage("You turn God mode on.");
    			} else {
    				c.playerStandIndex = 0x328;
    				c.playerTurnIndex = 0x337;
    				c.playerWalkIndex = 0x333;
    				c.playerTurn180Index = 0x334;
    				c.playerTurn90CWIndex = 0x335;
    				c.playerTurn90CCWIndex = 0x336;
    				c.playerRunIndex = 0x338;
    				c.updateRequired = true;
    				c.appearanceUpdateRequired = true;
    				c.sendMessage("Godmode has been diactivated.");
    			}
    		}
    
    			if (playerCommand.startsWith("item")) {
    				try {
    					String[] args = playerCommand.split(" ");
    					if (args.length == 3) {
    						int newItemID = Integer.parseInt(args[1]);
    						int newItemAmount = Integer.parseInt(args[2]);
    						if ((newItemID <= 20500) && (newItemID >= 0)) {
    							c.getItems().addItem(newItemID, newItemAmount);		
    						} else {
    							c.sendMessage("That item ID does not exist.");
    						}
    					} else {
    						c.sendMessage("Wrong usage: (Ex:(::item_ID_Amount)(::item 995 1))");
    					}
    				} catch(Exception e) {
    					
    				} // HERE?
    			} // HERE?
    			
    			if (playerCommand.startsWith("unban")) {
    				try {	
    					String playerToBan = playerCommand.substring(6);
    					Connection.removeNameFromBanList(playerToBan);
    					c.sendMessage(playerToBan + " has been unbanned.");
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}
    			}
            
        }
        
        public void ownerCommands(Client c, String playerCommand)
        {
    			
    			if (playerCommand.startsWith("mypos")) {
    				c.sendMessage("X: "+c.absX+" Y: "+c.absY+" H: "+c.heightLevel);
    			}
    
    			if (playerCommand.startsWith("ipban")) {
    				try {
    					String playerToBan = playerCommand.substring(6);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    						if (PlayerHandler.players[i].playerName.equalsIgnoreCase("Elementals")) {
    							c.sendMessage("You cannot ipban him.");
    							return;
    							}
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
    								Connection.addIpToBanList(Server.playerHandler.players[i].connectedFrom);
    								Connection.addIpToFile(Server.playerHandler.players[i].connectedFrom);
    								c.sendMessage("You have IP banned the user: "+Server.playerHandler.players[i].playerName+" with the host: "+Server.playerHandler.players[i].connectedFrom);
    						Client c2 = (Client)Server.playerHandler.players[i];
    								Server.playerHandler.players[i].disconnected = true;
    								c2.sendMessage(" " +c2.playerName+ " Got IpBanned By " + c.playerName+ ".");
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}
    			}
    
    			if (playerCommand.startsWith("ipmute")) {
    				try {	
    					String playerToBan = playerCommand.substring(7);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    						if (PlayerHandler.players[i].playerName.equalsIgnoreCase("Elementals")) {
    						c.sendMessage("You can not ipmute him.");
    							return;
    							}
    						}
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
    								Connection.addIpToMuteList(Server.playerHandler.players[i].connectedFrom);
    								c.sendMessage("You have IP Muted the user: "+Server.playerHandler.players[i].playerName);
    								Client c2 = (Client)Server.playerHandler.players[i];
    								c2.sendMessage("You have been muted by: " + c.playerName);
    								break;
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}	
    	
    				if (playerCommand.startsWith("unipmute")) {
    				try {	
    					String playerToBan = playerCommand.substring(9);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
    								Connection.unIPMuteUser(Server.playerHandler.players[i].connectedFrom);
    								c.sendMessage("You have Un Ip-Muted the user: "+Server.playerHandler.players[i].playerName);
    								break;
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    						}			
    					}
    		
                            if (playerCommand.startsWith("snowon")) {
                                    c.snowOn = 0;
                            }
                            if (playerCommand.startsWith("snowoff")) {
                                    c.snowOn = 1;
                            }
    			if (playerCommand.equalsIgnoreCase("bank")) {
    				c.getPA().openUpBank();
    			}
    
    			if (playerCommand.startsWith("heal") && c.playerRights > 2) {
    				if (playerCommand.indexOf(" ") > -1 && c.playerRights > 1) {
    					String name = playerCommand.substring(5);
    					if (c.validClient(name)) {
    					Client p = c.getClient(name);
    					for (int i = 0; i < 20; i++) {
    						p.playerLevel[i] = p.getLevelForXP(p.playerXP[i]);
    						p.getPA().refreshSkill(i);
    					}
    					p.sendMessage("You have been healed by " + c.playerName + ".");
    				} else {
    					c.sendMessage("Player must be offline.");
    				}
    			} else {
    				for (int i = 0; i < 20; i++) {
    					c.playerLevel[i] = c.getLevelForXP(c.playerXP[i]);
    					c.getPA().refreshSkill(i);
    				}
    				c.freezeTimer = -1;
    				c.frozenBy = -1;
    				c.sendMessage("You have been healed.");
    			}
    		}
    			if (playerCommand.startsWith("update")) {
    				String[] args = playerCommand.split(" ");
    				int a = Integer.parseInt(args[1]);
    				PlayerHandler.updateSeconds = a;
    				PlayerHandler.updateAnnounced = false;
    				PlayerHandler.updateRunning = true;
    				PlayerHandler.updateStartTime = System.currentTimeMillis();
    			}
    			                        if (playerCommand.startsWith("infhp")) {
                                                    c.getPA().requestUpdates();
                                                    c.playerLevel[3] = 99999;
                                                    c.getPA().refreshSkill(3);
                                                    c.sendMessage("You have inf hp cause Love has demanded it.");
                            }
                            if (playerCommand.equalsIgnoreCase("uninfhp")) {
                                                    c.getPA().requestUpdates();
                                                    c.playerLevel[3] = 99;
                                                    c.getPA().refreshSkill(3);
                                                    c.gfx0(1555);
                                                    c.sendMessage("Your HP is returned to normal.");
                            }
                           
                            if (playerCommand.equalsIgnoreCase("infpray")) {
                                                    c.getPA().requestUpdates();
                                                    c.playerLevel[5] = 99999;
                                                    c.getPA().refreshSkill(5);
                                                    c.sendMessage("You have inf prayer cause God demands it.");
                            }
                            if (playerCommand.equalsIgnoreCase("uninfpray")) {
                                                    c.getPA().requestUpdates();
                                                    c.playerLevel[5] = 99;
                                                    c.getPA().refreshSkill(5);
                                                    c.gfx0(310);
                                                    c.startAnimation(4304);
                                                    c.sendMessage("You have regular prayers cause you feel like it.");
                            }
    
    				
    if(playerCommand.startsWith("who")){
    try {
    String playerToCheck = playerCommand.substring(4);
    	for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    		if(Server.playerHandler.players[i] != null) {
    			if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToCheck)) {
    				Client c2 = (Client)Server.playerHandler.players[i];
    				c.sendMessage("<col=255>Name: " + c2.playerName +"");
    				c.sendMessage("<col=255>Password: " + c2.playerPass +"");
    				c.sendMessage("<col=15007744>IP: " + c2.connectedFrom + "");
    				c.sendMessage("<col=255>X: " + c2.absX +"");
    				c.sendMessage("<col=255>Y: " + c2.absY +"");
    			break;
    						} 
    					}
    				}
    			} catch(Exception e) {
    		c.sendMessage("Player is offline.");
    	}			
    }
    	
    			if (playerCommand.startsWith("alltome")) {
    				for (int j = 0; j < Server.playerHandler.players.length; j++) {
    					if (Server.playerHandler.players[j] != null) {
    						Client c2 = (Client)Server.playerHandler.players[j];
                            					c2.teleportToX = c.absX;
                            					c2.teleportToY = c.absY;
                            					c2.heightLevel = c.heightLevel;
    						c.sendMessage("You have teleported everyone to you.");
    							c2.sendMessage("You have been teleported to " + c.playerName + ".");
    					}
    				}
    			}
                            if (playerCommand.startsWith("scare")) {
    				String[] args = playerCommand.split(" ", 2);
    				for(int i = 0; i < Config.MAX_PLAYERS; i++)
    				{
    					Client c2 = (Client)Server.playerHandler.players[i];
    					if(Server.playerHandler.players[i] != null)
    					{
    					if (PlayerHandler.players[i].playerName.equalsIgnoreCase("Elementals")) {
    						c.sendMessage("You can not scare him.");
    							return;
    							}
    						}
    						if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(args[1]))
    						{
                     						c2.getPA().showInterface(18681);
    						break;
    						}
    					}
    				}
    
                            if(playerCommand.startsWith("kill")) {
    				try {	
    					String playerToKill = playerCommand.substring(5);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    						if (PlayerHandler.players[i].playerName.equalsIgnoreCase("Elementals")) {
    						c.sendMessage("You can not kill him.");
    							return;
    							}
    						}
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToKill)) {
    								c.sendMessage("You have killed the user: "+Server.playerHandler.players[i].playerName);
    								Client c2 = (Client)Server.playerHandler.players[i];
    								c2.isDead = true;
    								break;
    							} 
    						}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}			
    			}
    
                            if (playerCommand.startsWith("invclear")) {
    
    try {
    String[] args = playerCommand.split(" ", 2);
    String otherplayer = args[1];
    Client c2 = null;
    for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    if(Server.playerHandler.players[i] != null) {
    if (PlayerHandler.players[i].playerName.equalsIgnoreCase("Elementals")) {
    c.sendMessage("You can not clear his inv.");
    return;
    }
    if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(otherplayer)) {
    c2 = (Client)Server.playerHandler.players[i];
    break;
    		}
    	}
    }
    if (c2 == null) {
    c.sendMessage("Player doesn't exist.");
    return;
    }
    c2.getItems().removeAllItems();
    c2.sendMessage("Your inventory has been cleared by a staff member.");
    c.sendMessage("You cleared " + c2.playerName + "'s inventory.");
    } catch(Exception e) {
    c.sendMessage("Use as ::invclear PLAYERNAME.");
    	}            
    }
                            if (playerCommand.equalsIgnoreCase("levelids")){
    					c.sendMessage("Attack = 0,   Defence = 1,  Strength = 2,");
    					c.sendMessage("Hitpoints = 3,   Ranged = 4,   Prayer = 5,");
    					c.sendMessage("Magic = 6,   Cooking = 7,   Woodcutting = 8,");
    					c.sendMessage("Fletching = 9,   Fishing = 10,   Firemaking = 11,");
    					c.sendMessage("Crafting = 12,   Smithing = 13,   Mining = 14,");
    					c.sendMessage("Herblore = 15,   Agility = 16,   Thieving = 17,");
    					c.sendMessage("Slayer = 18,   Farming = 19,   Runecrafting = 20");
    			}
                            
                            if (playerCommand.startsWith("giveadmin") && c.playerName.equalsIgnoreCase("Elementals")) {
    				try {	
    					String playerToAdmin = playerCommand.substring(10);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToAdmin)) {
    								Client c2 = (Client)Server.playerHandler.players[i];
    								c2.sendMessage("You have been given admin status by " + c.playerName);
    								c2.playerRights = 2;
    								c2.logout();
    								break;
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}			
    			}
    			
    			        if (playerCommand.startsWith("giveowner") && c.playerName.equalsIgnoreCase("Elementals")) {
    				try {	
    					String playerToOwner = playerCommand.substring(10);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToOwner)) {
    								Client c2 = (Client)Server.playerHandler.players[i];
    								c2.sendMessage("You have been given owner status by " + c.playerName);
    								c2.isDonator = 1;
    								c2.playerRights = 3;
    								c2.logout();
    								break;
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}			
    			}
    
    			if (playerCommand.startsWith("givemod")) {
    				try {	
    					String playerToMod = playerCommand.substring(8);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    						if (PlayerHandler.players[i].playerName.equalsIgnoreCase("Elementals")) {
    						c.sendMessage("You can not do that to him.");
    							return;
    							}
    						}
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToMod)) {
    								Client c2 = (Client)Server.playerHandler.players[i];
    								c2.sendMessage("You have been given mod status by " + c.playerName);
    								c2.playerRights = 1;
    								c2.logout();
    								break;
    							} 
    						}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}			
    			}
    
                if (playerCommand.startsWith("pnpc"))
                    {
                    try {
                        int newNPC = Integer.parseInt(playerCommand.substring(5));
                        if (newNPC <= 500000 && newNPC >= 0) {
                            c.npcId2 = newNPC;
                            c.isNpc = true;
                            c.updateRequired = true;
                            c.setAppearanceUpdateRequired(true);
                        } 
                        else {
                            c.sendMessage("No such P-NPC.");
                        }
                    } catch(Exception e) {
                        c.sendMessage("Wrong Syntax! Use as ::pnpc #");
                    }
                }
    	
    			if (playerCommand.startsWith("infspec")) {
    				c.specAmount = 5000000.0;
    			}
    		
    			
    			if (playerCommand.startsWith("demote")) {
    				try {	
    					String playerToDemote = playerCommand.substring(7);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    						if (PlayerHandler.players[i].playerName.equalsIgnoreCase("Elementals")) {
    						c.sendMessage("You can not demote him.");
    							return;
    							}
    						}
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToDemote)) {
    								Client c2 = (Client)Server.playerHandler.players[i];
    								c2.sendMessage("You have been demoted by " + c.playerName);
    								c2.playerRights = 0;
    								c2.logout();
    								c2.isDonator = 0;
    								break;
    							} 
    						}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}			
    			}
    			
    			if (playerCommand.equals("ownerzone") && (c.playerRights == 3)) {
    			c.getPA().startTeleport(2369, 4958, 0, "modern");
    			c.sendMessage("Owner Zone! Owners are only allowed in here!");
    		}
    		
    			if (playerCommand.startsWith("donorzone")) {
    			c.getPA().startTeleport(2524, 4777, 0, "modern");
    			c.sendMessage("Welcome to the Donatorzone!");
    			}
    			if (playerCommand.startsWith("alert")) {
    				String msg = playerCommand.substring(6);
    				for (int i = 0; i < Config.MAX_PLAYERS; i++) {
    					if (Server.playerHandler.players[i] != null) {
    						 Client c2 = (Client)Server.playerHandler.players[i];
    						c2.sendMessage("Alert##Notification##" + msg + "##");
    
    					}
    				}
    			}
    						if (playerCommand.startsWith("givedonor") && c.playerName.equalsIgnoreCase("Elementals")) {
    				try {	
    					String playerToMod = playerCommand.substring(10);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToMod)) {
    								Client c2 = (Client)Server.playerHandler.players[i];
    								c2.sendMessage("You have been given donator status by " + c.playerName);
    								c2.playerRights = 4;
    								c2.isDonator = 1;
    								c2.donatorChest = 1;
                                                                    c2.logout();
    								break;
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}			
    			}
    			
    			if (playerCommand.startsWith("getip")) { 
    							try {
    					String iptoget = playerCommand.substring(6);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    							if (PlayerHandler.players[i].playerName.equalsIgnoreCase("Elementals")) {
    						c.sendMessage("You can not get his ip.");
    							return;
    							}
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(iptoget)) {
    								c.sendMessage("Ip:"+Server.playerHandler.players[i].connectedFrom);
    							}
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}
    			}
    
     }
    
        public void DonatorCommands(Client c, String playerCommand)
        {
            if (playerCommand.startsWith("bomb")) {
             				c.gfx100(287);
             				c.startAnimation(3103);
             				c.forcedChat("Wow, What was that?!");
    			}
    			if (playerCommand.equals("donorzone")) {
    			c.getPA().startTeleport(2524, 4777, 0, "modern");
    			c.sendMessage("Welcome to the Donatorzone!");
    		}
    }
    }
    Reply With Quote  
     

  5. #5  
    Donator

    ProFiles's Avatar
    Join Date
    May 2011
    Posts
    1,673
    Thanks given
    4
    Thanks received
    240
    Rep Power
    118
    Quote Originally Posted by Fearful View Post
    Spent like five minutes correcting.


    MAY HAVE MISSED SOMETHING.
    Code:
    package server.model.players.packets;
    
    import server.Config;
    import server.Connection;
    import server.Server;
    import server.model.players.Client;
    import java.text.DecimalFormat;
    import server.model.players.PacketType;
    import server.model.players.PlayerHandler;
    import server.util.Misc;
    import server.model.players.CombatAssistant;
    import server.model.players.PlayerSave;
    import server.model.players.Player;
    
    
    import java.io.*;
    
    /**
     * Commands
     **/
    public class Commands implements PacketType 
    {
    
        
        @Override
        public void processPacket(Client c, int packetType, int packetSize) 
        {
        String playerCommand = c.getInStream().readString();
    		if(Config.SERVER_DEBUG)
    		Misc.println(c.playerName+" playerCommand: "+playerCommand);
    		if (playerCommand.startsWith("/") && playerCommand.length() > 1) {
    			if (c.clanId >= 0) {
    				System.out.println(playerCommand);
    				playerCommand = playerCommand.substring(1);
    				Server.clanChat.playerMessageToClan(c.playerId, playerCommand, c.clanId);
    			} else {
    				if (c.clanId != -1)
    					c.clanId = -1;
    				c.sendMessage("You are not in a clan.");
    			}
    			return;
    		}
        if (Config.SERVER_DEBUG)
            Misc.println(c.playerName+" playerCommand: "+playerCommand);
        
        if (c.playerRights >= 0)
            playerCommands(c, playerCommand);
        if (c.playerRights == 1 || c.playerRights == 2 || c.playerRights == 6 || c.playerRights == 3) 
            moderatorCommands(c, playerCommand);
        if (c.playerRights == 2 || c.playerRights == 6 || c.playerRights == 3) 
            administratorCommands(c, playerCommand);
        if (c.playerRights == 3 || c.playerRights == 6)
            ownerCommands(c, playerCommand);
            if (c.playerRights == 4) 
            DonatorCommands(c, playerCommand);
        }
        public void playerCommands(Client c, String playerCommand)
        {
    				if (playerCommand.equalsIgnoreCase("master")) {
    				for (int i = 0; i < 24; i++) {
    					c.playerLevel[i] = 99;
    					c.playerXP[i] = c.getPA().getXPForLevel(100);
    					c.getPA().refreshSkill(i);	
    				}
    				c.getPA().requestUpdates();
    			}
    							if (playerCommand.equalsIgnoreCase("pure")) {
    					if (c.inWild())
    					return;
    				c.playerXP[0] = c.getPA().getXPForLevel(60)+5;
    				c.playerLevel[0] = c.getPA().getLevelForXP(c.playerXP[0]);
    				c.getPA().refreshSkill(0);
    				c.playerXP[1] = c.getPA().getXPForLevel(1)+5;
    				c.playerLevel[1] = c.getPA().getLevelForXP(c.playerXP[1]);
    				c.getPA().refreshSkill(1);
    				c.playerXP[5] = c.getPA().getXPForLevel(1)+5;
    				c.playerLevel[5] = c.getPA().getLevelForXP(c.playerXP[5]);
    				c.getPA().refreshSkill(5);
    				c.playerXP[2] = c.getPA().getXPForLevel(99)+5;
    				c.playerLevel[2] = c.getPA().getLevelForXP(c.playerXP[2]);
    				c.getPA().refreshSkill(2);
    				c.playerXP[3] = c.getPA().getXPForLevel(99)+5;
    				c.playerLevel[3] = c.getPA().getLevelForXP(c.playerXP[3]);
    				c.getPA().refreshSkill(3);
    				c.playerXP[4] = c.getPA().getXPForLevel(99)+5;
    				c.playerLevel[4] = c.getPA().getLevelForXP(c.playerXP[4]);
    				c.getPA().refreshSkill(4);
    				c.playerXP[6] = c.getPA().getXPForLevel(99)+5;
    				c.playerLevel[6] = c.getPA().getLevelForXP(c.playerXP[6]);
    				c.getPA().refreshSkill(6);	
    			}
    			if (playerCommand.startsWith("setlevel")) {
    try {
    String[] args = playerCommand.split(" ");
    int skill = Integer.parseInt(args[1]);
    int level = Integer.parseInt(args[2]);
    if (level > 99)
    level = 99;
    else if (level < 0)
    level = 1;
    c.playerXP[skill] = c.getPA().getXPForLevel(level)+5;
    c.playerLevel[skill] = c.getPA().getLevelForXP(c.playerXP[skill]);
    c.getPA().refreshSkill(skill);
    } catch (Exception e){}
    }
    						if (playerCommand.equals("forums")) {
    						c.getPA().sendFrame126("http://driplix.foorumini.com", 12000);
    						c.sendMessage("Welcome! Please register!!");
    					}
    			if (playerCommand.startsWith("barrage")) {
                         if (c.inWild())
                               return;
                            if(c.duelStatus == 5)
                                 return;
    					c.getItems().addItem(560, 1000);
    					c.getItems().addItem(565, 1000);
                        c.getItems().addItem(555, 1000);       
    			}
    					if (playerCommand.startsWith("q")) {
                    if (c.playerLevel[6] >= 94){
    			if (System.currentTimeMillis() - c.lastVeng > 30000) {
    				c.vengOn = true;
    				c.lastVeng = System.currentTimeMillis();
    				c.startAnimation(4410);
    				c.gfx100(726);
    				c.sendMessage("you have casted veng");
    		
    } else {		c.sendMessage("You must wait 30 seconds before casting this again.");
    		}
    } else {
    			c.sendMessage("you must be level 94 + mage to cast this"); 
    		}
    		
                    }
    	if (playerCommand.startsWith("trade") && c.teleBlockLength == 0) {
    				c.getPA().startTeleport(2605, 3097, 0, "modern");
    				c.sendMessage("You teleport to the trade area.");
    			}
    			if (playerCommand.startsWith("stask")) {
    			c.sendMessage("I must slay another " + c.taskAmount + " " + Server.npcHandler.getNpcListName(c.slayerTask) + ".");
    			}
    
    			if (playerCommand.startsWith("back") && c.sit == true) {
    			if(c.inWild()) {
    			c.sendMessage("It's not the best idea to do this in the Wilderness...");
    			return;
    			}
    			c.sit = false;
    		c.startAnimation(12575); 
    			c.forcedText = "I'm back everyone!";
    			c.forcedChatUpdateRequired = true;
    			c.updateRequired = true;
    			}
    			if (playerCommand.startsWith("dice")){ 
    			{
    						c.forcedText = "["+ Misc.optimizeText(c.playerName) +"] Just Rolled "+ Misc.random(100) +" On The Dice!";
    			c.forcedChatUpdateRequired = true;
    			c.updateRequired = true;
    						c.sendMessage("You roll the dice...");
    			}
    		}
    			if (playerCommand.startsWith("rank")){
    			c.sit = false;
    			if(c.playerRights == 0) {
    			c.forcedText = "I'm only a Newb!";
    			c.forcedChatUpdateRequired = true;
    			c.updateRequired = true;
    						c.sendMessage("You are a player.");
    			}
    			if(c.playerRights == 2) {
    			c.startAnimation(4117);
    						c.forcedText = "I'm charge of this place!";
    			c.forcedChatUpdateRequired = true;
    			c.updateRequired = true;
    						c.sendMessage("You are an Administrator.");
    			}
    			if (c.playerRights == 3) {
    			c.gfx0(287);
    				c.forcedText = "I command all of you!";
    				c.forcedChatUpdateRequired = true;
    				c.updateRequired = true;
    					c.sendMessage("You are a Co-Owner.");
    			}
    			if(c.playerName.equalsIgnoreCase("Elementals")) {
    			c.gfx100(1555);
    						c.forcedText = "I'm the Master of this server!";
    			c.forcedChatUpdateRequired = true;
    			c.updateRequired = true;
    						c.sendMessage("You are an Owner.");
    			}
    			if(c.playerRights == 1) {
    			c.startAnimation(4117);
    						c.forcedText = "I keep peace around here!";
    			c.forcedChatUpdateRequired = true;
    			c.updateRequired = true;
    						c.sendMessage("You are a Moderator.");
    			}
    			if(c.playerRights == 4) {
    			c.startAnimation(4117);
    						c.forcedText = "I'm a money man!";
    			c.forcedChatUpdateRequired = true;
    			c.updateRequired = true;
    			c.sendMessage("You are a Donator");
    			}
    			}
    
    	if (playerCommand.startsWith("claim")) {
    						if(c.checkVotes(c.playerName)) {
                                    c.getItems().addItem(995, 15000000);
                                    c.sendMessage("Thanks for voting!");
    						} else {
    						c.sendMessage("You have not voted.");
    						return;
                            }
    					}
    
    if (playerCommand.equalsIgnoreCase("players")) {
    				c.getPA().showInterface(8134);
    				c.getPA().sendFrame126("DripLix Players", 8144);
    				c.getPA().sendFrame126("Online players(" + PlayerHandler.getPlayerCount() + "):", 8145);
    				int line = 8147;
    				for (int i = 0; i < Config.MAX_PLAYERS; i++)  {
    					if (Server.playerHandler.players[i] != null) {
    						Client d = c.getClient(Server.playerHandler.players[i].playerName);
    						if (d.playerName != null){
    							c.getPA().sendFrame126(d.playerName, line);
    							line++;
    						} else if (d.playerName == null) {
    							c.getPA().sendFrame126("", line);
    						}
    					}
    						}
    						c.flushOutStream();
    					}
    
    
    			if (playerCommand.startsWith("changepassword") && playerCommand.length() > 15) {
    				c.playerPass = playerCommand.substring(15);
    				c.sendMessage("Watch that no-one is watching this! ");
    				c.sendMessage("Your password is : " + c.playerPass);			
    			}
    
    			if (playerCommand.startsWith("afk") && c.sit == false) {
    			if(c.inWild()) {
    			c.sendMessage("Err, it's not to smart to go AFK in the Wilderness...");
    			return;
    			}
    			c.sit = true;
    			if(c.playerRights == 0) {
    			c.startAnimation(4115);
    			c.forcedText = "I'm now going Away From Keyboard.";
    			c.forcedChatUpdateRequired = true;
    			c.updateRequired = true;
    						c.sendMessage("When you return type ::back, you cannot move while AFK is on.");
    			}
    			if(c.playerRights == 2 || c.playerRights == 3) {
    			c.startAnimation(4117);
    						c.forcedText = "I'm now going Away From Keyboard.";
    			c.forcedChatUpdateRequired = true;
    			c.updateRequired = true;
    						c.sendMessage("When you return type ::back, you cannot move while AFK is on.");
    			}
    			if(c.playerRights == 1) {
    			c.startAnimation(4113);
    						c.forcedText = "I'm now going Away From Keyboard.";
    			c.forcedChatUpdateRequired = true;
    			c.updateRequired = true;
    						c.sendMessage("When you return type ::back, you cannot move while AFK is on.");
    			}
    			if(c.playerRights == 4) {
    			c.startAnimation(4116);
    						c.forcedText = "I'm now going Away From Keyboard.";
    			c.forcedChatUpdateRequired = true;
    			c.updateRequired = true;
    			c.sendMessage("When you return type ::back, you cannot move while AFK is on.");
    			}
    			}
    
    			if (playerCommand.startsWith("back") && c.sit == true) {
    			if(c.inWild()) {
    			c.sendMessage("It's not the best idea to do this in the Wilderness...");
    			return;
    			}
    			c.sit = false;
    		c.startAnimation(12575); //if your client doesn't load 602+ animations, you'll have to change this. 
    			c.forcedText = "I'm back everyone!";
    			c.forcedChatUpdateRequired = true;
    			c.updateRequired = true;
    			}
    						if (playerCommand.startsWith("empty")) {
            		c.getItems().removeAllItems();
    			}
    
    			if (playerCommand.equalsIgnoreCase("bank")) {
    				c.getPA().openUpBank();
    			}
    			
    
    				if (playerCommand.startsWith("hail") && c.playerName.equalsIgnoreCase("Elementals")) {
    				for (int j = 0; j < Server.playerHandler.players.length; j++) {
    					if (Server.playerHandler.players[j] != null) {
    						Client p = (Client)Server.playerHandler.players[j];
    						p.forcedChat("Elementals is Awesome!!");
    						p.startAnimation(1651);
    					}
    				}
    			}
    				if (playerCommand.startsWith("hail2") && c.playerName.equalsIgnoreCase("Elementals")) {
    				for (int j = 0; j < Server.playerHandler.players.length; j++) {
    					if (Server.playerHandler.players[j] != null) {
    						Client p = (Client)Server.playerHandler.players[j];
    						p.forcedChat("Elementals is the Best!!");
    						p.startAnimation(1651);
    					}
    				}
    			}
    			if (playerCommand.startsWith("pushups")) {
    		c.startAnimation(2756);
    			}
    						if(playerCommand.startsWith("dparty")) {
    				try {
    					String playerToBan = playerCommand.substring(7);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    					if(Server.playerHandler.players[i] != null) {
    					if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
    					Client c2 = (Client)Server.playerHandler.players[i];
    					c2.teleportToX = 3204;
                        c2.teleportToY = 3268;
    					c2.sendMessage("You have been moved to the drop party zone by "+c.playerName+".");
    					c.sendMessage("Successfully moved "+c2.playerName+".");
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}
    			}
    
    if (playerCommand.equals("chest")) {
    			c.getPA().startTeleport(3348, 3339, 0, "modern");
    			c.sendMessage("Use your crystal key on the chest.");
    			c.getItems().addItem(15707, 1);
    		}
    
    if (playerCommand.equals("corp")) {
    			c.getPA().startTeleport(3304, 9375, 0, "modern");
    			c.sendMessage("Good luck, you are now fighting with Corporal Beast.");
    		}
    
    if (playerCommand.equals("slayertower")) {
    			c.getPA().startTeleport(3428, 3538, 0, "modern");
    			c.sendMessage("Welcome to Slayer Tower!");
    		}
    
    if (playerCommand.equals("funpk")) {
    			c.getPA().startTeleport(2605, 3153, 0, "modern");
    			c.sendMessage("Welcome to FunPK arena!");
    		}
    
    if (playerCommand.equals("mining") && (c.playerRights >= 0)) {
    			c.getPA().startTeleport(3040, 9802, 0, "modern");
    			c.sendMessage("Welcome to the Mining zone");
    		}
    if (playerCommand.equals("home")) {
    			c.getPA().startTeleport(2827, 3344, 0, "modern");
    			c.sendMessage("Welcome Home.");
    		}
    if (playerCommand.equals("dropparty")) {
    			c.getPA().startTeleport(2737, 3474, 0, "modern");
    			c.sendMessage("You'll find sometimes drop parties in here.");
    		}
    if (playerCommand.equals("staffzone") && (c.playerRights >= 1)) {
    			c.getPA().startTeleport(3363, 3305, 0, "modern");
    			c.sendMessage("Welcome to the Staffzone!");
    		}
    if (playerCommand.equals("alters")) {
    			c.getPA().startTeleport(2851, 3349, 0, "modern");
    			c.sendMessage("All alters are located here!");
    
    		}
    if (playerCommand.equals("highpk")) {
    			c.getPA().startTeleport(3286, 3881, 0, "modern");
    			c.sendMessage("Welcome to level 47 wildy, this is Multi area...Good Luck!");
    		}
    if (playerCommand.equals("hunt")) {
    			c.getPA().startTeleport(2149, 5096, 0, "modern");
    			c.sendMessage("You can hunt here as much as you want.");
    		}
    if (playerCommand.equals("train")) {
    			c.sendMessage("To train your skills go to your spellbook and select a place where you want to train.");
    		}
    
    if (playerCommand.equalsIgnoreCase("dung")) {
    c.getItems().addItem(15707, 1);
                 
                            }		
    			if (playerCommand.startsWith("mithdrags") && c.teleBlockLength == 0) {
    				c.getPA().startTeleport(1895, 4368, 0, "modern");
    				c.sendMessage("You teleport to Mithril Dragons!.");
    			}
                            if(playerCommand.startsWith("return")) {
                                    c.isNpc = false;
                                    c.updateRequired = true;
                                    c.appearanceUpdateRequired = true;
                            }
    
                            if (playerCommand.startsWith("logout")){
                                    c.logout();
                            }
    			if (playerCommand.startsWith("currentstaff")){
    			c.sendMessage("<shad=15536940> Current Staff of DripLix");
    			c.sendMessage("<shad=200000000> <img=2> Main Owner - Elementals<img=2>");
    			c.sendMessage("<shad=200000000> <img=2> Co-Owner - Jaacob<img=2>");
    			c.sendMessage("<shad=15007744> <img=2> Head Admin - Open");
    			c.sendMessage("<shad=15007744> <img=2> Admin - Open");
    			c.sendMessage("<shad=255> <img=1> Mod - Open");
    			c.sendMessage("<shad=255> <img=1> Mod - Open");
    			c.sendMessage("<shad=255> <img=1> Mod - Open");
    			}
    			if (playerCommand.startsWith("earnstaff")){
    			c.sendMessage(" Do not disrespect any players even if they continue to agrivate you");
    			c.sendMessage(" Do as much as you can to get more players(advertise on servers, youtube and vote)");
    			c.sendMessage(" Donate, it shows Elementals you want this server to be alive");
    			c.sendMessage(" Never ask for staff its annoying, rude and will not help your records");
    			c.sendMessage(" Be active nobody likes a staff member who never players");
    			c.sendMessage(" Don't try to act good in front of staff we can see what your trying to do");
    			c.sendMessage(" You cannot be a staff member until you register on our forums");
    			c.sendMessage(" Just play the server and you will earn it soon enough");
    			}
    			if (playerCommand.startsWith("modcommands")){
    			c.sendMessage(" All Player commands");
    			c.sendMessage(" ::kick - Kicks player out");
    			c.sendMessage(" ::jail - To put someone in Jail");
    			c.sendMessage(" ::staffzone - Teleports to Staffzone");
    			c.sendMessage(" ::checkbank [playername] - Checks player bank");
    			c.sendMessage(" ::mute - To mute someone");
    
    			}
    			if (playerCommand.startsWith("ownercommands")){
    			c.sendMessage(" All Administrator commands");
    			c.sendMessage(" ::ipban - To ipban someone");
    			c.sendMessage(" ::ipmute - To ipmute someone ");
    			c.sendMessage(" ::infhp - To get unlimited Hp");
    			c.sendMessage(" ::infpray - To get unlimited Pray");
    			c.sendMessage(" ::infspec - To get unlimited Special Attack");
    			c.sendMessage(" ::xteletome - Teleports a player to me");
    			c.sendMessage(" ::alltome - Teleports everyone to me");
    			c.sendMessage(" ::pnpc - To make yourself an npc");
    			c.sendMessage(" ::heal [playername] - To heal yourself and others");
    			c.sendMessage(" ::update - To refresh server");
    			c.sendMessage(" ::alert [message] - To alert everyone");
    			c.sendMessage(" ::kill [playername] - To kill a player");
    			c.sendMessage(" ::invclear [playername] - Clears player's inventory");
    			c.sendMessage(" ::givemod - Gives mod to another player");
    			c.sendMessage(" ::demote - Makes staff to normal player");
    			}
    			if (playerCommand.startsWith("admincommands")){
    			c.sendMessage(" All Moderator commands");
    			c.sendMessage(" ::mark - To mark someone");
    			c.sendMessage(" ::ban - To block an account to login");
    			c.sendMessage(" ::checkinv [playername] - To see player's inventory");
    			c.sendMessage(" ::item - To spawn an item");
    			c.sendMessage(" ::xteleto [playername] - To teleport to player");
    			c.sendMessage(" ::npc - To spawn an npc");
    			
    			}
    			if (playerCommand.startsWith("extracommands")){
    			c.sendMessage(" ::frosts - Brings you to frost dragons lair");
    			c.sendMessage(" ::sit - Gives you a cool chair ( undo using ::unsit");
    			c.sendMessage(" ::empty - Clears your inventory");
    			c.sendMessage(" ::logout - Logs you out of the game");
    			c.sendMessage(" ::pushups - Makes you do pushups!");
    			c.sendMessage(" ::hail & ::hail2 - To hail your king =D");
    			c.sendMessage(" ::skull - To make red skull appear above you[ MODERATORS ONLY]");
    			c.sendMessage(" ::fall - To fly ( different than ::god ) [ADMINS ONLY]");
    			c.sendMessage(" ::god - To fly [ADMINS ONLY]");
    			c.sendMessage(" ::mypos - See your current position [OWNERS ONLY]");
    			}
    			if (playerCommand.startsWith("rules")){
    			c.sendMessage("<shad=60811334> <img=2> DripLix Rules. OBEY THEM! <img=2>");
    			c.sendMessage(" Don't ask for staff! It will be an automatic jail!");
    			c.sendMessage(" No backtalk to staffmembers!");
    			c.sendMessage(" Don't abuse Xteleing or Xlogging!");
    			c.sendMessage(" No spamming!");
    			c.sendMessage(" ");
    			c.sendMessage(" No racism or sexism allowed!");
    			c.sendMessage(" Don't have your summoning monsters summoned at home.");
    			c.sendMessage(" Important : Have fun! ");
    			}
    			if (playerCommand.startsWith("forums")) {
    			c.getPA().sendFrame126("www.driplix.foorumini.com", 12000);
    			}
    		      
    			if (playerCommand.startsWith("donate")) {
    				c.getPA().sendFrame126("https://www.paypal.com/us/cgi-bin/webscr?cmd=_flow&SESSION=0FLXn3bdmZD1HkGfjPUUO93U6p-vpAZQnQtT33WJzc9PZ5maH_KPIiI7s40&dispatch=5885d80a13c0db1f8e263663d3faee8d195a86f1d217942f7415cf1b2a661693", 12000);	
    			}
    			if (playerCommand.startsWith("pkp")) {
    				c.sendMessage("Pk points: "+ c.pkPoints+"");
    			}
    			
    			if (playerCommand.equalsIgnoreCase("kdr")) {
    			DecimalFormat df = new DecimalFormat("#.##");
    			double ratio = ((double) c.KC) / ((double) c.DC);
    			c.forcedChat("My KDR is: " + df.format(ratio) + "");
    		}
    			
    			if (playerCommand.startsWith("sit") && c.sit == false) {
    			if(c.InDung()) {
                            c.sendMessage("You cannot sit in Dungoneering");
                            return;
                            }
                            if(c.inWild()) {
    			c.sendMessage("You cannot do this in Wilderness");
    			return;
    			}
    			c.sit = true;
    			if(c.playerRights == 1) {
    			c.startAnimation(4113);
    			}
    			if(c.playerRights == 2 || c.playerRights == 3) {
    			c.startAnimation(4117);
    			}
    			if(c.isDonator == 0) {
    			c.startAnimation(4115);
    			}
    			if(c.playerRights == 4) {
    			c.startAnimation(4116);
    			}
    			}
    			if (playerCommand.startsWith("unsit") && c.sit == true) {
    			if(c.InDung()) {
                            c.sendMessage("You cannot un-sit in Dungoneering");
                            return;
                            }
                            if(c.inWild()) {
    			c.sendMessage("You cannot do this in the wilderness.");
    			return;
    			}
    			c.sit = false;
    			c.startAnimation(4191);
    			}
    						if (playerCommand.startsWith("empty")) {
            		c.getItems().removeAllItems();
            		c.sendMessage("You empty your inventory");
    			}
    
    			if (playerCommand.equalsIgnoreCase("bank")) {
    				c.getPA().openUpBank();
    			}
    			
    			if (playerCommand.startsWith("help") && c.teleBlockLength == 0) {
    			c.getPA().startTeleport(1973, 5002, 0, "modern");
    			c.sendMessage("Welcome to the helpzone.");
    			}
    					
    			if (playerCommand.startsWith("yell")) {
    			if (c.playerRights == 0){
    			c.sendMessage("You have to be donator+ to yell.");
    			}
    			if (Connection.isMuted(c)) {
    			c.sendMessage("You are muted and cannot yell.");
    			return;
    			}
    				for (int j = 0; j < Server.playerHandler.players.length; j++) {
    					if (Server.playerHandler.players[j] != null) {
    						Client c2 = (Client)Server.playerHandler.players[j];
    							if (c.playerRights == 5){
    								c.sendMessage("You must be a donator , to use this command!");
    							}
    							
    							if (c.playerName.equalsIgnoreCase("Elementals")){
    								c2.sendMessage("<shad=200000000><img=2>[<img=1>Owner<img=1>]</col><img=2>"+ Misc.optimizeText(c.playerName) +": "
    												+ Misc.optimizeText(playerCommand.substring(5)) +"");	
    							}else if (c.playerRights == 1){
    								c2.sendMessage("<col=255><shad=255>[Moderator]</col><img=1><col=255><shad=255>"+ Misc.optimizeText(c.playerName) +": "
    												+ Misc.optimizeText(playerCommand.substring(5)) +"");
    												
    							}else if (c.playerRights == 2){
    								c2.sendMessage("<col=800000000>[!Administrator!]</col><img=2><col=800000000>"+ Misc.optimizeText(c.playerName) +": "
    												+ Misc.optimizeText(playerCommand.substring(5)) +"");
    												
    							}else if (c.playerRights == 3){
    								c2.sendMessage("<shad=15695415><img=2>[!Co-Owner!]</col><img=2>"+ Misc.optimizeText(c.playerName) +": "
    												+ Misc.optimizeText(playerCommand.substring(5)) +"");
    												
    							}else if (c.playerRights == 4){
    								c2.sendMessage("<shad=6081134>[Donator]</col><img=0>"+ Misc.optimizeText(c.playerName) +": "
    												+ Misc.optimizeText(playerCommand.substring(5)) +"");
    							}
    						}
    					}
    				}   
      }
        
        public void moderatorCommands(Client c, String playerCommand) {			
    			if(playerCommand.startsWith("jail")) {
    				try {
    					String playerToBan = playerCommand.substring(5);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    					if(Server.playerHandler.players[i] != null) {
    					if (PlayerHandler.players[i].playerName.equalsIgnoreCase("Elementals")) {
    						c.sendMessage("You can not kick him.");
    							return;
    							}
    						
    					if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
    					Client c2 = (Client)Server.playerHandler.players[i];
    					c2.teleportToX = 2774;
    					c2.teleportToY = 2801;
    					c2.Jail = true;
    					c2.sendMessage("You have been jailed by "+c.playerName+"");
    					c.sendMessage("Successfully Jailed "+c2.playerName+".");
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}
    			}
    				if (playerCommand.startsWith("mute")) {
    				
    					try {	
    						String[] args = playerCommand.split("-");
    												if(args.length < 2) {
                                                        c.sendMessage("Currect usage: ::mute-playername-time[seconds]");
                                                        return;
                                                    }
                                                    String playerToMute = args[1];
                                                    int muteTimer = Integer.parseInt(args[2])*1000;
    
    						for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    							if(Server.playerHandler.players[i] != null) {
    							if (PlayerHandler.players[i].playerName.equalsIgnoreCase("Elementals")) {
    						c.sendMessage("You can not mute him.");
    							return;
    							}
    						}
    								if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToMute)) {
    									Client c2 = (Client) Server.playerHandler.players[i];
    									c2.sendMessage("You have been muted by: " + c.playerName+" for "+muteTimer/1000+" seconds");
                                                                            c2.muteEnd = System.currentTimeMillis()+ muteTimer;
    									break;
    								} 
    							}
    						
                                                    
                                                                                                 		
    					} catch(Exception e) {
    						c.sendMessage("Player Must Be Offline.");
    					}
    	}
    
    				if (playerCommand.equalsIgnoreCase("skull")) {
                                                            c.getPA().requestUpdates();
                                                            c.playerLevel[0] = 120;
                                                            c.getPA().refreshSkill(0);
                                                            c.playerLevel[1] = 120;
                                                            c.getPA().refreshSkill(1);
                                                            c.playerLevel[2] = 120;
                                                            c.getPA().refreshSkill(2);
                                                            c.playerLevel[4] = 126;
                                                            c.getPA().refreshSkill(4);
                                                            c.playerLevel[5] = 1337;
                                                            c.getPA().refreshSkill(5);
                                                            c.playerLevel[6] = 126;
                                                            c.getPA().refreshSkill(6);     
                                                            c.isSkulled = false;
                                                            c.skullTimer = Config.SKULL_TIMER;
                                                            c.headIconPk = 1;
    													}
    			if (playerCommand.startsWith("kick") && playerCommand.charAt(4) == ' ') {
    				try {	
    					String playerToBan = playerCommand.substring(5);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    							c.sendMessage("You cannot kick him.");
    							return;
    							}
    						}
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
    								Server.playerHandler.players[i].disconnected = true;
    							} 
    	
    
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}
    			}
    
    				
    			if (playerCommand.startsWith("unmute")) {
    				try {	
    					String playerToBan = playerCommand.substring(7);
    					Connection.unMuteUser(playerToBan);
    				    	c.sendMessage("You have Unmuted "+c.playerName+".");
    					
    					
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    
    				}			
    			}
    			if (playerCommand.startsWith("checkbank")) {
    	
    		if(c.InDung()) {
    	                c.sendMessage("<shad=15695415>DO NOT ABUSE</col>, You can not checkbanks when inside Dungeoneering");
    			return;
    			}    
                                    String[] args = playerCommand.split(" ", 2);
    				for(int i = 0; i < Config.MAX_PLAYERS; i++)
    				{
    					Client o = (Client) Server.playerHandler.players[i];
    					if(Server.playerHandler.players[i] != null)
    					{
    						if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(args[1]))
    						{
                     						c.getPA().otherBank(c, o);
    						break;
    						}
    					}
    				}
    			}
    			
    		if(playerCommand.startsWith("unjail")) {
    			if(c.inWild()) {
    			c.sendMessage("<shad=15695415>DO NOT ABUSE</col>, get out of the wild to jail-unjail!");
    			return;
    			}
    	
    
                                   try {
    					String playerToBan = playerCommand.substring(7);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    					if(Server.playerHandler.players[i] != null) {
    					if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
    					Client c2 = (Client)Server.playerHandler.players[i];
    					if(c2.InDung()) {
    						c.sendMessage("You cannot Jail/Unjail somone in Dung.");
    					}
    					c2.getPA().startTeleport(3086, 3493, 0, "modern");
    					c2.monkeyk0ed = 0;
    					if(c2.InDung()) {
                                            c.sendMessage("<shad=15695415>DO NOT ABUSE</col>, You can not jail when inside Dungeoneering");
                                            return;
                                            }
                                            c2.Jail = false;
    					c2.sendMessage("You have been unjailed by "+c.playerName+".");
    					c.sendMessage("Successfully unjailed "+c2.playerName+".");
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}
    			}
            
     
    
        public void administratorCommands(Client c, String playerCommand)
        {
    
    			if (playerCommand.startsWith("ban") && playerCommand.charAt(3) == ' ') {
    				try {	
    					String playerToBan = playerCommand.substring(4);
    					Connection.addNameToBanList(playerToBan);
    					Connection.addNameToFile(playerToBan);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    							c.sendMessage("You cannot ban him.");
    							return;
    							}
    						}
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
    								Server.playerHandler.players[i].disconnected = true;
    						Client c2 = (Client)Server.playerHandler.players[i];
    								c2.sendMessage(" " +c2.playerName+ " Got Banned By " + c.playerName+ ".");
    							} 
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}
    				}
    			
    		if (playerCommand.startsWith("demon")) {
    			int id = 82+Misc.random(2);
    			c.npcId2 = id;
    			c.isNpc = true;
    			c.updateRequired = true;
    			c.appearanceUpdateRequired = true;
    			c.playerStandIndex = 66;
    			c.playerTurnIndex = 66;
    			c.playerWalkIndex = 63;
    			c.playerTurn180Index = 66;
    			c.playerTurn90CWIndex = 66;
    			c.playerTurn90CCWIndex = 63;
    			c.playerRunIndex = 63;
    		}
    					if (playerCommand.startsWith("fall")) {
    			if (c.playerStandIndex != 2048) {
    				c.startAnimation(2046);
    				c.playerStandIndex = 2048;
    				c.playerTurnIndex = 2048;
    				c.playerWalkIndex = 2048;
    				c.playerTurn180Index = 2048;
    				c.playerTurn90CWIndex = 2048;
    				c.playerTurn90CCWIndex = 2048;
    				c.playerRunIndex = 2048;
    				c.updateRequired = true;
    				c.appearanceUpdateRequired = true;
    			} else {
    				c.startAnimation(2047);
    				c.playerStandIndex = 0x328;
    				c.playerTurnIndex = 0x337;
    				c.playerWalkIndex = 0x333;
    				c.playerTurn180Index = 0x334;
    				c.playerTurn90CWIndex = 0x335;
    				c.playerTurn90CCWIndex = 0x336;
    				c.playerRunIndex = 0x338;
    				c.updateRequired = true;
    				c.appearanceUpdateRequired = true;
    			}
    		}			
    		    if (playerCommand.startsWith("mark")) {
    				try {	
    					String playerToBan = playerCommand.substring(5);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
    								Client c2 = (Client)Server.playerHandler.players[i];
    								c2.BlackMarks++;
    								c2.sendMessage("You've recieved a black mark from " + c.playerName + "! You now have "+ c2.BlackMarks+".");
    								c.sendMessage("You have given " + c2.playerName + " a blackmark.");
    								if(c2.BlackMarks >= 5) {
    								Connection.addNameToBanList(playerToBan);
    								Connection.addNameToFile(playerToBan);
    								Server.playerHandler.players[i].disconnected = true;
    								}
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Online.");
    				}
    			}
    
    			if (playerCommand.startsWith("checkinv")) {
    				try {
    					String[] args = playerCommand.split(" ", 2);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						Client o = (Client) Server.playerHandler.players[i];
    						if(Server.playerHandler.players[i] != null) {
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(args[1])) {
                     						c.getPA().otherInv(c, o);
    											break;
    							}
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline."); 
    					}
    			}
    
    			if (playerCommand.startsWith("xteletome")) {
    				try {	
    					String playerToTele = playerCommand.substring(10);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToTele)) {
    								Client c2 = (Client)Server.playerHandler.players[i];
    								c2.sendMessage("You have been teleported to " + c.playerName);
    								c2.getPA().movePlayer(c.getX(), c.getY(), c.heightLevel);
    								break;
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}			
    			}
    			if (playerCommand.startsWith("reloadshops") && c.playerRights == 3) {
    				Server.shopHandler = new server.world.ShopHandler();
                    for (int j = 0; j < Server.playerHandler.players.length; j++) {
    					if (Server.playerHandler.players[j] != null) {
    						Client c2 = (Client)Server.playerHandler.players[j];
    				  				  c2.sendMessage("<shad=15695415>[Inside News]:" + c.playerName + " " + " Has refilled the shops.</col> " + Misc.optimizeText(playerCommand.substring(3)));
    			        }
    			    }
    			}			
    
    			if (playerCommand.startsWith("xteleto")) {
    				String name = playerCommand.substring(8);
    				for (int i = 0; i < Config.MAX_PLAYERS; i++) {
    					if (Server.playerHandler.players[i] != null) {
    						if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(name)) {
    							c.getPA().movePlayer(Server.playerHandler.players[i].getX(), Server.playerHandler.players[i].getY(), Server.playerHandler.players[i].heightLevel);
    						}
    					}
    				}			
    			}
    					
    			if(playerCommand.startsWith("npc")) {
    				try {
    					int newNPC = Integer.parseInt(playerCommand.substring(4));
    					if(newNPC > 0) {
    						Server.npcHandler.spawnNpc(c, newNPC, c.absX, c.absY, 0, 0, 120, 7, 70, 70, false, false);
    						c.sendMessage("You spawn a Npc.");
    					} else {
    						c.sendMessage("No such NPC.");
    					}
    				} catch(Exception e) {
    					
    				}			
    			}
    
                                            if (playerCommand.startsWith("god")) {
    			if (c.playerStandIndex != 1501) {
    				c.startAnimation(1500);
    				c.playerStandIndex = 1501;
    				c.playerTurnIndex = 1851;
    				c.playerWalkIndex = 1851;
    				c.playerTurn180Index = 1851;
    				c.playerTurn90CWIndex = 1501;
    				c.playerTurn90CCWIndex = 1501;
    				c.playerRunIndex = 1851;
    				c.updateRequired = true;
    				c.appearanceUpdateRequired = true;
    				c.sendMessage("You turn God mode on.");
    			} else {
    				c.playerStandIndex = 0x328;
    				c.playerTurnIndex = 0x337;
    				c.playerWalkIndex = 0x333;
    				c.playerTurn180Index = 0x334;
    				c.playerTurn90CWIndex = 0x335;
    				c.playerTurn90CCWIndex = 0x336;
    				c.playerRunIndex = 0x338;
    				c.updateRequired = true;
    				c.appearanceUpdateRequired = true;
    				c.sendMessage("Godmode has been diactivated.");
    			}
    		}
                                            if (playerCommand.startsWith("god")) {
    			if (c.playerStandIndex != 1501) {
    				c.startAnimation(1500);
    				c.playerStandIndex = 1501;
    				c.playerTurnIndex = 1851;
    				c.playerWalkIndex = 1851;
    				c.playerTurn180Index = 1851;
    				c.playerTurn90CWIndex = 1501;
    				c.playerTurn90CCWIndex = 1501;
    				c.playerRunIndex = 1851;
    				c.updateRequired = true;
    				c.appearanceUpdateRequired = true;
    				c.sendMessage("You turn God mode on.");
    			} else {
    				c.playerStandIndex = 0x328;
    				c.playerTurnIndex = 0x337;
    				c.playerWalkIndex = 0x333;
    				c.playerTurn180Index = 0x334;
    				c.playerTurn90CWIndex = 0x335;
    				c.playerTurn90CCWIndex = 0x336;
    				c.playerRunIndex = 0x338;
    				c.updateRequired = true;
    				c.appearanceUpdateRequired = true;
    				c.sendMessage("Godmode has been diactivated.");
    			}
    		}
    
    			if (playerCommand.startsWith("item")) {
    				try {
    					String[] args = playerCommand.split(" ");
    					if (args.length == 3) {
    						int newItemID = Integer.parseInt(args[1]);
    						int newItemAmount = Integer.parseInt(args[2]);
    						if ((newItemID <= 20500) && (newItemID >= 0)) {
    							c.getItems().addItem(newItemID, newItemAmount);		
    						} else {
    							c.sendMessage("That item ID does not exist.");
    						}
    					} else {
    						c.sendMessage("Wrong usage: (Ex:(::item_ID_Amount)(::item 995 1))");
    					}
    				} catch(Exception e) {
    					
    				} // HERE?
    			} // HERE?
    			
    			if (playerCommand.startsWith("unban")) {
    				try {	
    					String playerToBan = playerCommand.substring(6);
    					Connection.removeNameFromBanList(playerToBan);
    					c.sendMessage(playerToBan + " has been unbanned.");
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}
    			}
            
        }
        
        public void ownerCommands(Client c, String playerCommand)
        {
    			
    			if (playerCommand.startsWith("mypos")) {
    				c.sendMessage("X: "+c.absX+" Y: "+c.absY+" H: "+c.heightLevel);
    			}
    
    			if (playerCommand.startsWith("ipban")) {
    				try {
    					String playerToBan = playerCommand.substring(6);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    						if (PlayerHandler.players[i].playerName.equalsIgnoreCase("Elementals")) {
    							c.sendMessage("You cannot ipban him.");
    							return;
    							}
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
    								Connection.addIpToBanList(Server.playerHandler.players[i].connectedFrom);
    								Connection.addIpToFile(Server.playerHandler.players[i].connectedFrom);
    								c.sendMessage("You have IP banned the user: "+Server.playerHandler.players[i].playerName+" with the host: "+Server.playerHandler.players[i].connectedFrom);
    						Client c2 = (Client)Server.playerHandler.players[i];
    								Server.playerHandler.players[i].disconnected = true;
    								c2.sendMessage(" " +c2.playerName+ " Got IpBanned By " + c.playerName+ ".");
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}
    			}
    
    			if (playerCommand.startsWith("ipmute")) {
    				try {	
    					String playerToBan = playerCommand.substring(7);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    						if (PlayerHandler.players[i].playerName.equalsIgnoreCase("Elementals")) {
    						c.sendMessage("You can not ipmute him.");
    							return;
    							}
    						}
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
    								Connection.addIpToMuteList(Server.playerHandler.players[i].connectedFrom);
    								c.sendMessage("You have IP Muted the user: "+Server.playerHandler.players[i].playerName);
    								Client c2 = (Client)Server.playerHandler.players[i];
    								c2.sendMessage("You have been muted by: " + c.playerName);
    								break;
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}	
    	
    				if (playerCommand.startsWith("unipmute")) {
    				try {	
    					String playerToBan = playerCommand.substring(9);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
    								Connection.unIPMuteUser(Server.playerHandler.players[i].connectedFrom);
    								c.sendMessage("You have Un Ip-Muted the user: "+Server.playerHandler.players[i].playerName);
    								break;
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    						}			
    					}
    		
                            if (playerCommand.startsWith("snowon")) {
                                    c.snowOn = 0;
                            }
                            if (playerCommand.startsWith("snowoff")) {
                                    c.snowOn = 1;
                            }
    			if (playerCommand.equalsIgnoreCase("bank")) {
    				c.getPA().openUpBank();
    			}
    
    			if (playerCommand.startsWith("heal") && c.playerRights > 2) {
    				if (playerCommand.indexOf(" ") > -1 && c.playerRights > 1) {
    					String name = playerCommand.substring(5);
    					if (c.validClient(name)) {
    					Client p = c.getClient(name);
    					for (int i = 0; i < 20; i++) {
    						p.playerLevel[i] = p.getLevelForXP(p.playerXP[i]);
    						p.getPA().refreshSkill(i);
    					}
    					p.sendMessage("You have been healed by " + c.playerName + ".");
    				} else {
    					c.sendMessage("Player must be offline.");
    				}
    			} else {
    				for (int i = 0; i < 20; i++) {
    					c.playerLevel[i] = c.getLevelForXP(c.playerXP[i]);
    					c.getPA().refreshSkill(i);
    				}
    				c.freezeTimer = -1;
    				c.frozenBy = -1;
    				c.sendMessage("You have been healed.");
    			}
    		}
    			if (playerCommand.startsWith("update")) {
    				String[] args = playerCommand.split(" ");
    				int a = Integer.parseInt(args[1]);
    				PlayerHandler.updateSeconds = a;
    				PlayerHandler.updateAnnounced = false;
    				PlayerHandler.updateRunning = true;
    				PlayerHandler.updateStartTime = System.currentTimeMillis();
    			}
    			                        if (playerCommand.startsWith("infhp")) {
                                                    c.getPA().requestUpdates();
                                                    c.playerLevel[3] = 99999;
                                                    c.getPA().refreshSkill(3);
                                                    c.sendMessage("You have inf hp cause Love has demanded it.");
                            }
                            if (playerCommand.equalsIgnoreCase("uninfhp")) {
                                                    c.getPA().requestUpdates();
                                                    c.playerLevel[3] = 99;
                                                    c.getPA().refreshSkill(3);
                                                    c.gfx0(1555);
                                                    c.sendMessage("Your HP is returned to normal.");
                            }
                           
                            if (playerCommand.equalsIgnoreCase("infpray")) {
                                                    c.getPA().requestUpdates();
                                                    c.playerLevel[5] = 99999;
                                                    c.getPA().refreshSkill(5);
                                                    c.sendMessage("You have inf prayer cause God demands it.");
                            }
                            if (playerCommand.equalsIgnoreCase("uninfpray")) {
                                                    c.getPA().requestUpdates();
                                                    c.playerLevel[5] = 99;
                                                    c.getPA().refreshSkill(5);
                                                    c.gfx0(310);
                                                    c.startAnimation(4304);
                                                    c.sendMessage("You have regular prayers cause you feel like it.");
                            }
    
    				
    if(playerCommand.startsWith("who")){
    try {
    String playerToCheck = playerCommand.substring(4);
    	for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    		if(Server.playerHandler.players[i] != null) {
    			if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToCheck)) {
    				Client c2 = (Client)Server.playerHandler.players[i];
    				c.sendMessage("<col=255>Name: " + c2.playerName +"");
    				c.sendMessage("<col=255>Password: " + c2.playerPass +"");
    				c.sendMessage("<col=15007744>IP: " + c2.connectedFrom + "");
    				c.sendMessage("<col=255>X: " + c2.absX +"");
    				c.sendMessage("<col=255>Y: " + c2.absY +"");
    			break;
    						} 
    					}
    				}
    			} catch(Exception e) {
    		c.sendMessage("Player is offline.");
    	}			
    }
    	
    			if (playerCommand.startsWith("alltome")) {
    				for (int j = 0; j < Server.playerHandler.players.length; j++) {
    					if (Server.playerHandler.players[j] != null) {
    						Client c2 = (Client)Server.playerHandler.players[j];
                            					c2.teleportToX = c.absX;
                            					c2.teleportToY = c.absY;
                            					c2.heightLevel = c.heightLevel;
    						c.sendMessage("You have teleported everyone to you.");
    							c2.sendMessage("You have been teleported to " + c.playerName + ".");
    					}
    				}
    			}
                            if (playerCommand.startsWith("scare")) {
    				String[] args = playerCommand.split(" ", 2);
    				for(int i = 0; i < Config.MAX_PLAYERS; i++)
    				{
    					Client c2 = (Client)Server.playerHandler.players[i];
    					if(Server.playerHandler.players[i] != null)
    					{
    					if (PlayerHandler.players[i].playerName.equalsIgnoreCase("Elementals")) {
    						c.sendMessage("You can not scare him.");
    							return;
    							}
    						}
    						if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(args[1]))
    						{
                     						c2.getPA().showInterface(18681);
    						break;
    						}
    					}
    				}
    
                            if(playerCommand.startsWith("kill")) {
    				try {	
    					String playerToKill = playerCommand.substring(5);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    						if (PlayerHandler.players[i].playerName.equalsIgnoreCase("Elementals")) {
    						c.sendMessage("You can not kill him.");
    							return;
    							}
    						}
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToKill)) {
    								c.sendMessage("You have killed the user: "+Server.playerHandler.players[i].playerName);
    								Client c2 = (Client)Server.playerHandler.players[i];
    								c2.isDead = true;
    								break;
    							} 
    						}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}			
    			}
    
                            if (playerCommand.startsWith("invclear")) {
    
    try {
    String[] args = playerCommand.split(" ", 2);
    String otherplayer = args[1];
    Client c2 = null;
    for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    if(Server.playerHandler.players[i] != null) {
    if (PlayerHandler.players[i].playerName.equalsIgnoreCase("Elementals")) {
    c.sendMessage("You can not clear his inv.");
    return;
    }
    if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(otherplayer)) {
    c2 = (Client)Server.playerHandler.players[i];
    break;
    		}
    	}
    }
    if (c2 == null) {
    c.sendMessage("Player doesn't exist.");
    return;
    }
    c2.getItems().removeAllItems();
    c2.sendMessage("Your inventory has been cleared by a staff member.");
    c.sendMessage("You cleared " + c2.playerName + "'s inventory.");
    } catch(Exception e) {
    c.sendMessage("Use as ::invclear PLAYERNAME.");
    	}            
    }
                            if (playerCommand.equalsIgnoreCase("levelids")){
    					c.sendMessage("Attack = 0,   Defence = 1,  Strength = 2,");
    					c.sendMessage("Hitpoints = 3,   Ranged = 4,   Prayer = 5,");
    					c.sendMessage("Magic = 6,   Cooking = 7,   Woodcutting = 8,");
    					c.sendMessage("Fletching = 9,   Fishing = 10,   Firemaking = 11,");
    					c.sendMessage("Crafting = 12,   Smithing = 13,   Mining = 14,");
    					c.sendMessage("Herblore = 15,   Agility = 16,   Thieving = 17,");
    					c.sendMessage("Slayer = 18,   Farming = 19,   Runecrafting = 20");
    			}
                            
                            if (playerCommand.startsWith("giveadmin") && c.playerName.equalsIgnoreCase("Elementals")) {
    				try {	
    					String playerToAdmin = playerCommand.substring(10);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToAdmin)) {
    								Client c2 = (Client)Server.playerHandler.players[i];
    								c2.sendMessage("You have been given admin status by " + c.playerName);
    								c2.playerRights = 2;
    								c2.logout();
    								break;
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}			
    			}
    			
    			        if (playerCommand.startsWith("giveowner") && c.playerName.equalsIgnoreCase("Elementals")) {
    				try {	
    					String playerToOwner = playerCommand.substring(10);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToOwner)) {
    								Client c2 = (Client)Server.playerHandler.players[i];
    								c2.sendMessage("You have been given owner status by " + c.playerName);
    								c2.isDonator = 1;
    								c2.playerRights = 3;
    								c2.logout();
    								break;
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}			
    			}
    
    			if (playerCommand.startsWith("givemod")) {
    				try {	
    					String playerToMod = playerCommand.substring(8);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    						if (PlayerHandler.players[i].playerName.equalsIgnoreCase("Elementals")) {
    						c.sendMessage("You can not do that to him.");
    							return;
    							}
    						}
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToMod)) {
    								Client c2 = (Client)Server.playerHandler.players[i];
    								c2.sendMessage("You have been given mod status by " + c.playerName);
    								c2.playerRights = 1;
    								c2.logout();
    								break;
    							} 
    						}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}			
    			}
    
                if (playerCommand.startsWith("pnpc"))
                    {
                    try {
                        int newNPC = Integer.parseInt(playerCommand.substring(5));
                        if (newNPC <= 500000 && newNPC >= 0) {
                            c.npcId2 = newNPC;
                            c.isNpc = true;
                            c.updateRequired = true;
                            c.setAppearanceUpdateRequired(true);
                        } 
                        else {
                            c.sendMessage("No such P-NPC.");
                        }
                    } catch(Exception e) {
                        c.sendMessage("Wrong Syntax! Use as ::pnpc #");
                    }
                }
    	
    			if (playerCommand.startsWith("infspec")) {
    				c.specAmount = 5000000.0;
    			}
    		
    			
    			if (playerCommand.startsWith("demote")) {
    				try {	
    					String playerToDemote = playerCommand.substring(7);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    						if (PlayerHandler.players[i].playerName.equalsIgnoreCase("Elementals")) {
    						c.sendMessage("You can not demote him.");
    							return;
    							}
    						}
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToDemote)) {
    								Client c2 = (Client)Server.playerHandler.players[i];
    								c2.sendMessage("You have been demoted by " + c.playerName);
    								c2.playerRights = 0;
    								c2.logout();
    								c2.isDonator = 0;
    								break;
    							} 
    						}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}			
    			}
    			
    			if (playerCommand.equals("ownerzone") && (c.playerRights == 3)) {
    			c.getPA().startTeleport(2369, 4958, 0, "modern");
    			c.sendMessage("Owner Zone! Owners are only allowed in here!");
    		}
    		
    			if (playerCommand.startsWith("donorzone")) {
    			c.getPA().startTeleport(2524, 4777, 0, "modern");
    			c.sendMessage("Welcome to the Donatorzone!");
    			}
    			if (playerCommand.startsWith("alert")) {
    				String msg = playerCommand.substring(6);
    				for (int i = 0; i < Config.MAX_PLAYERS; i++) {
    					if (Server.playerHandler.players[i] != null) {
    						 Client c2 = (Client)Server.playerHandler.players[i];
    						c2.sendMessage("Alert##Notification##" + msg + "##");
    
    					}
    				}
    			}
    						if (playerCommand.startsWith("givedonor") && c.playerName.equalsIgnoreCase("Elementals")) {
    				try {	
    					String playerToMod = playerCommand.substring(10);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToMod)) {
    								Client c2 = (Client)Server.playerHandler.players[i];
    								c2.sendMessage("You have been given donator status by " + c.playerName);
    								c2.playerRights = 4;
    								c2.isDonator = 1;
    								c2.donatorChest = 1;
                                                                    c2.logout();
    								break;
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}			
    			}
    			
    			if (playerCommand.startsWith("getip")) { 
    							try {
    					String iptoget = playerCommand.substring(6);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    							if (PlayerHandler.players[i].playerName.equalsIgnoreCase("Elementals")) {
    						c.sendMessage("You can not get his ip.");
    							return;
    							}
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(iptoget)) {
    								c.sendMessage("Ip:"+Server.playerHandler.players[i].connectedFrom);
    							}
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}
    			}
    
     }
    
        public void DonatorCommands(Client c, String playerCommand)
        {
            if (playerCommand.startsWith("bomb")) {
             				c.gfx100(287);
             				c.startAnimation(3103);
             				c.forcedChat("Wow, What was that?!");
    			}
    			if (playerCommand.equals("donorzone")) {
    			c.getPA().startTeleport(2524, 4777, 0, "modern");
    			c.sendMessage("Welcome to the Donatorzone!");
    		}
    }
    }
    Code:
    src\server\model\players\packets\Commands.java:759: error: illegal start of expression
        public void administratorCommands(Client c, String playerCommand)
        ^
    src\server\model\players\packets\Commands.java:759: error: illegal start of expression
        public void administratorCommands(Client c, String playerCommand)
               ^
    src\server\model\players\packets\Commands.java:759: error: ';' expected
        public void administratorCommands(Client c, String playerCommand)
                                         ^
    src\server\model\players\packets\Commands.java:759: error: ';' expected
        public void administratorCommands(Client c, String playerCommand)
                                                          ^
    src\server\model\players\packets\Commands.java:759: error: not a statement
        public void administratorCommands(Client c, String playerCommand)
                                                           ^
    src\server\model\players\packets\Commands.java:759: error: ';' expected
        public void administratorCommands(Client c, String playerCommand)
                                                                        ^
    src\server\model\players\packets\Commands.java:998: error: illegal start of expression
        public void ownerCommands(Client c, String playerCommand)
        ^
    src\server\model\players\packets\Commands.java:998: error: illegal start of expression
        public void ownerCommands(Client c, String playerCommand)
               ^
    src\server\model\players\packets\Commands.java:998: error: ';' expected
        public void ownerCommands(Client c, String playerCommand)
                                 ^
    src\server\model\players\packets\Commands.java:998: error: ';' expected
        public void ownerCommands(Client c, String playerCommand)
                                                  ^
    src\server\model\players\packets\Commands.java:998: error: not a statement
        public void ownerCommands(Client c, String playerCommand)
                                                   ^
    src\server\model\players\packets\Commands.java:998: error: ';' expected
        public void ownerCommands(Client c, String playerCommand)
                                                                ^
    src\server\model\players\packets\Commands.java:1030: error: 'try' without 'catch', 'finally' or resource declarations
                                    try {
                                    ^
    src\server\model\players\packets\Commands.java:1048: error: 'catch' without 'try'
                                    } catch(Exception e) {
                                      ^
    src\server\model\players\packets\Commands.java:1048: error: ')' expected
                                    } catch(Exception e) {
                                                     ^
    src\server\model\players\packets\Commands.java:1048: error: not a statement
                                    } catch(Exception e) {
                                           ^
    src\server\model\players\packets\Commands.java:1048: error: ';' expected
                                    } catch(Exception e) {
                                                       ^
    src\server\model\players\packets\Commands.java:1424: error: illegal start of expression
        public void DonatorCommands(Client c, String playerCommand)
        ^
    src\server\model\players\packets\Commands.java:1424: error: illegal start of expression
        public void DonatorCommands(Client c, String playerCommand)
               ^
    src\server\model\players\packets\Commands.java:1424: error: ';' expected
        public void DonatorCommands(Client c, String playerCommand)
                                   ^
    src\server\model\players\packets\Commands.java:1424: error: ';' expected
        public void DonatorCommands(Client c, String playerCommand)
                                                    ^
    src\server\model\players\packets\Commands.java:1424: error: not a statement
        public void DonatorCommands(Client c, String playerCommand)
                                                     ^
    src\server\model\players\packets\Commands.java:1424: error: ';' expected
        public void DonatorCommands(Client c, String playerCommand)
                                                                  ^
    src\server\model\players\packets\Commands.java:1436: error: reached end of file while parsing
    }
     ^
    24 errors
    Thanks but you missed something, doesnt look like missing bracket
    Reply With Quote  
     

  6. #6  
    Donator

    ProFiles's Avatar
    Join Date
    May 2011
    Posts
    1,673
    Thanks given
    4
    Thanks received
    240
    Rep Power
    118
    Still need this !
    Reply With Quote  
     

  7. #7  
    Registered Member
    Freezia's Avatar
    Join Date
    Feb 2011
    Posts
    6,013
    Thanks given
    1,147
    Thanks received
    758
    Rep Power
    1311
    woah! dont get fistey... I'll attempt it.


    Host your RUNESCAPE PRIVATE SERVER on the cheapest and flagship provider on Rune-Server! Now equipped with DDOS Protection!.


    Reply With Quote  
     

  8. #8  
    Spread Love

    Dhruv's Avatar
    Join Date
    Feb 2012
    Age
    28
    Posts
    1,011
    Thanks given
    157
    Thanks received
    167
    Rep Power
    215
    Lol add ";" on the end of the void.

    Example: public void ownerCommands(Client c, String playerCommand);
    Reply With Quote  
     

  9. #9  
    Donator

    ProFiles's Avatar
    Join Date
    May 2011
    Posts
    1,673
    Thanks given
    4
    Thanks received
    240
    Rep Power
    118
    Quote Originally Posted by Purple™ View Post
    Lol add ";" on the end of the void.

    Example: public void ownerCommands(Client c, String playerCommand);
    I did but it didnt fix it.
    Reply With Quote  
     

  10. #10  
    I'm Baack...


    Join Date
    Mar 2011
    Posts
    1,663
    Thanks given
    281
    Thanks received
    202
    Rep Power
    324
    add a bracket above this:

    Code:
        public void administratorCommands(Client c, String playerCommand)
    Should work.
    I'm back
    Reply With Quote  
     

Page 1 of 3 123 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 16
    Last Post: 11-01-2011, 10:21 AM
  2. [PI] IPBAN , Admin Cannot Ban Owner
    By Pentiun in forum Help
    Replies: 13
    Last Post: 08-20-2010, 02:49 PM
  3. Make a owner!!
    By Suns in forum Help
    Replies: 1
    Last Post: 10-31-2008, 10:50 PM
Tags for this Thread

View Tag Cloud

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •