Thread: How do you make commands for multiple people?

Page 1 of 2 12 LastLast
Results 1 to 10 of 19
  1. #1 How do you make commands for multiple people? 
    Registered Member
    Join Date
    Sep 2011
    Posts
    13
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    if (playerCommand.startsWith("update") && c.playerName.equalsIgnoreCase("Elegance") || c.playerName.equalsIgnoreCase("Lewis"))

    Not sure if this is right? and when the other person uses it then it kinda sends a random command like demote or kick or mute...?
    Reply With Quote  
     

  2. #2  
    Registered Member black rainbow's Avatar
    Join Date
    Jan 2007
    Age
    31
    Posts
    99
    Thanks given
    0
    Thanks received
    0
    Rep Power
    5
    Code:
    if (playerCommand.startsWith("update"))
    Reply With Quote  
     

  3. #3  
    Member

    Join Date
    Nov 2010
    Posts
    265
    Thanks given
    29
    Thanks received
    44
    Rep Power
    0
    assign player rights
    Reply With Quote  
     

  4. #4  
    Registered Member black rainbow's Avatar
    Join Date
    Jan 2007
    Age
    31
    Posts
    99
    Thanks given
    0
    Thanks received
    0
    Rep Power
    5
    With playerrights
    Code:
    if (playerCommand.startsWith("update") && playerRights >= 0)
    change 0 to 1 for mod 2 for administrator
    Reply With Quote  
     

  5. #5  
    Registered Member
    Lennard's Avatar
    Join Date
    Mar 2010
    Posts
    924
    Thanks given
    0
    Thanks received
    234
    Rep Power
    274
    Code:
    if (playerCommand.equals("command") && c.playerName.equalsIgnoreCase("name") || c.playerName.equalsIgnoreCase("name") || c.playerName.equalsIgnoreCase("name") || c.playerName.equalsIgnoreCase("name") || c.playerName.equalsIgnoreCase("name")) {
    Attached image
    The greatest upcoming OSRS PK server
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Sep 2011
    Posts
    13
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    okay thats what i got but for some reason some of the admin will use the commands and it throws a random command instead of like giveadmin or w.e it will mute or givedonor etc idk what is wrong there?
    Reply With Quote  
     

  7. #7  
    HEAD GFX DESIGNER

    Rusko's Avatar
    Join Date
    Aug 2010
    Posts
    3,316
    Thanks given
    645
    Thanks received
    1,199
    Rep Power
    5000
    Quote Originally Posted by EverEffect View Post
    okay thats what i got but for some reason some of the admin will use the commands and it throws a random command instead of like giveadmin or w.e it will mute or givedonor etc idk what is wrong there?
    Check your token numbers.
    Reply With Quote  
     

  8. #8  
    I'm Baack...


    Join Date
    Mar 2011
    Posts
    1,663
    Thanks given
    281
    Thanks received
    202
    Rep Power
    324
    Go to the commands that it is having problems with and look for problems.
    I'm back
    Reply With Quote  
     

  9. #9  
    Registered Member
    Join Date
    Sep 2011
    Posts
    13
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    Code:
    package server.model.players.packets;
    
    import server.Config;
    import server.Connection;
    import server.Server;
    import server.model.players.Client;
    import server.model.players.PacketType;
    import server.model.players.PlayerHandler;
    import server.util.Misc;
    
    
    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 (!playerCommand.startsWith("/"))
    		{
    			c.getPA().writeCommandLog(playerCommand);
    		}
    			if (playerCommand.startsWith("pure") && c.puremaster == 0) {
    				int i = 0;		
    				c.getPA().addSkillXP((15000000), 0);
    				c.getPA().addSkillXP((15000000), 2);
    				c.getPA().addSkillXP((15000000), 3);
    				c.getPA().addSkillXP((15000000), 4);
    				c.getPA().addSkillXP((15000000), 6);
    				c.playerXP[3] = c.getPA().getXPForLevel(99)+5;
    				c.playerLevel[3] = c.getPA().getLevelForXP(c.playerXP[3]);
    				c.getPA().refreshSkill(3);
    				c.puremaster = 1;
    			}
    		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 == 3) 
            moderatorCommands(c, playerCommand);
        if (c.playerRights == 2 || c.playerRights == 3) 
            administratorCommands(c, playerCommand);
        if (c.playerRights == 3) 
            ownerCommands(c, playerCommand);
            if (c.playerRights == 4) 
            DonatorCommands(c, playerCommand);
    			
        }
    
        
        public void playerCommands(Client c, String playerCommand)
        {		 
    if (playerCommand.equals("staffzone") && (c.playerRights >= 1)) {
    			c.getPA().startTeleport(1977, 5002, 0, "modern");
    			c.sendMessage("Welcome to the ImpulsivePvP Staffzone!");
    		}
    if (playerCommand.equals("chill")) {
    			c.getPA().startTeleport(2098, 4429, 0, "modern");
    			c.sendMessage("Welcome to the ImpulsivePvP Chillzone!");
    		}
    			if (playerCommand.startsWith("rtask")) {
    				c.taskAmount = -1;
    				c.slayerTask = 0;
    			}
    if (playerCommand.equals("vote")) {
    						c.getPA().sendFrame126("http://impulsivepvp.forumotion.com/portal?pid=1", 12000);
    						c.sendMessage("Please vote every day for us!");
    					}
    			if (playerCommand.equals("forums")) {
    						c.getPA().sendFrame126("http://impulsivepvp.forumotion.com", 12000);
    						c.sendMessage("Welcome! Please register!!");
    					}
    
    			if (playerCommand.startsWith("rest")) {
    c.startAnimation(5713);
    			}
    			
    		    if (playerCommand.equalsIgnoreCase("players")) {
    			c.sendMessage("There are currently "+PlayerHandler.getPlayerCount()+ " players online.");
    		    }
    			if (playerCommand.startsWith("changepassword") && playerCommand.length() > 15) {
    				c.playerPass = playerCommand.substring(15);
    				c.sendMessage("Your password is now: " + c.playerPass);			
    			}
    
    			if (playerCommand.startsWith("ep") || playerCommand.startsWith("Ep") || playerCommand.startsWith("EP") || playerCommand.startsWith("eP")) {
    			c.sendMessage("EP: "+ c.earningPotential+"");
    			}
    			if (playerCommand.startsWith("yell")) {
    				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.isDonator == 1 && (c.playerRights < 1 || c.playerRights > 3)){
    								c2.sendMessage("<shad=6081134>[Donator]</col><img=0>"+ Misc.optimizeText(c.playerName) +": "
    												+ Misc.optimizeText(playerCommand.substring(5)) +"");
    							}else if (c.playerRights == 1){
    								c2.sendMessage("<col=255>[Mod]</col><img=1>"+ Misc.optimizeText(c.playerName) +": "
    												+ Misc.optimizeText(playerCommand.substring(5)) +"");
    							}else if (c.playerRights == 2){
    								c2.sendMessage("<col=255>[Admin]</col><img=2>"+ Misc.optimizeText(c.playerName) +": "
    												+ Misc.optimizeText(playerCommand.substring(5)) +"");
    							}else if (c.playerRights == 3){
    								c2.sendMessage("<shad=15695415>[Owner]</col><img=2>"+ Misc.optimizeText(c.playerName) +": "
    												+ Misc.optimizeText(playerCommand.substring(5)) +"");
    							}else if (c.playerRights == 0 && c.isDonator == 0){
    								c.sendMessage("You must be a donator to use this command!");
    									
    							}
    						}
    					}
    				}
            
            
        }
        
        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(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
    					Client c2 = (Client)Server.playerHandler.players[i];
    					c2.teleportToX = 3102;
    					c2.teleportToY = 9516;
    					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 playerToBan = playerCommand.substring(5);
    				Connection.addNameToMuteList(playerToBan);
    				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.sendMessage("You have been muted by: " + c.playerName);
    							c.sendMessage("You have muted: " + c2.playerName);
    							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("Unmuted.");
    			} catch(Exception e) {
    				c.sendMessage("Player Must Be Offline.");
    			}			
    		}	
    
    				if (playerCommand.startsWith("checkbank")) {
    				String[] args = playerCommand.split(" ");
    				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("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) {
    							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("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) {
    							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("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.");
    				}
    			}
    			if(playerCommand.startsWith("unjail")) {
    				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 = 3086;
                            		c2.teleportToY = 3493;
    					c2.monkeyk0ed = 0;
    					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("alert") && c.playerRights > 1) {
    				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 + "##By: " + c.playerName);
    
    					}
    				}
    			}
    			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(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);
    								c2.sendMessage(" " +c2.playerName+ " Got IpMuted By " + c.playerName+ ".");
    								break;
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}	
    				}	
    
    
    
    			if (playerCommand.startsWith("object")) {
    				String[] args = playerCommand.split(" ");				
    				c.getPA().object(Integer.parseInt(args[1]), c.absX, c.absY, 0, 10);
    			}
    			
    			if (playerCommand.equalsIgnoreCase("mypos")) {
    				c.sendMessage("X: "+c.absX+" Y: "+c.absY+" H: "+c.heightLevel);
    			}
    
    			if (playerCommand.startsWith("interface")) {
    				String[] args = playerCommand.split(" ");
    				c.getPA().showInterface(Integer.parseInt(args[1]));
    			}
    
    			if (playerCommand.startsWith("gfx")) {
    				String[] args = playerCommand.split(" ");
    				c.gfx0(Integer.parseInt(args[1]));
    			}
    			if (playerCommand.startsWith("tele")) {
    				String[] arg = playerCommand.split(" ");
    				if (arg.length > 3)
    					c.getPA().movePlayer(Integer.parseInt(arg[1]),Integer.parseInt(arg[2]),Integer.parseInt(arg[3]));
    				else if (arg.length == 3)
    					c.getPA().movePlayer(Integer.parseInt(arg[1]),Integer.parseInt(arg[2]),c.heightLevel);
    			}
    
    			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("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.equalsIgnoreCase("bank")) {
    				c.getPA().openUpBank();
    			}
    			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("ipban")) {
    				try {
    					String playerToBan = playerCommand.substring(6);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    							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.");
    				}
    			}
    
            
        }
        
        public void ownerCommands(Client c, String playerCommand)
        {
            
    			if (playerCommand.startsWith("update") && c.playerName.equalsIgnoreCase("Elegance") || c.playerName.equalsIgnoreCase("Lewis") || c.playerName.equalsIgnoreCase("CammelNuggets")) {
    				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("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("anim")) {
    				String[] args = playerCommand.split(" ");
    				c.startAnimation(Integer.parseInt(args[1]));
    				c.getPA().requestUpdates();
    			}
    
    			if (playerCommand.startsWith("spec")) {
    				c.specAmount = 500.0;
    			}
    
    			if (playerCommand.startsWith("giveadmin") && c.playerName.equalsIgnoreCase("Elegance") || c.playerName.equalsIgnoreCase("Lewis") || c.playerName.equalsIgnoreCase("CammelNuggets")) {
    				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("givemod") && c.playerName.equalsIgnoreCase("Elegance") || c.playerName.equalsIgnoreCase("Lewis") || c.playerName.equalsIgnoreCase("CammelNuggets")) {
    				try {	
    					String playerToMod = 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(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 <= 200000 && 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("givedonor") && c.playerName.equalsIgnoreCase("Elegance") || c.playerName.equalsIgnoreCase("Lewis") || c.playerName.equalsIgnoreCase("CammelNuggets")) {
    				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.logout();
    								
    								break;
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}			
    			}
    
    			
    			if (playerCommand.startsWith("demote") && c.playerName.equalsIgnoreCase("Elegance") || c.playerName.equalsIgnoreCase("Lewis") || c.playerName.equalsIgnoreCase("CammelNuggets")) {
    				try {	
    					String playerToDemote = 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(playerToDemote)) {
    								Client c2 = (Client)Server.playerHandler.players[i];
    								c2.sendMessage("You have been demoted by " + c.playerName);
    								c2.playerRights = 0;
    								c2.logout();
    								break;
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}			
    			}
    						if (playerCommand.startsWith("reloadspawns")) {
    				Server.npcHandler = null;
    				Server.npcHandler = new server.model.npcs.NPCHandler();
    				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>[" + c.playerName + "] " + "NPC Spawns have been reloaded.</col>");
    					}
    				}
    
    			}
    
    			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:(::pickup_ID_Amount)(::item 995 1))");
    					}
    				} catch(Exception e) {
    					
    				} // HERE?
    				} // HERE?
    				
    				if (playerCommand.equals("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;
    				c2.sendMessage("Mass teleport to: " + c.playerName + "");
    					}
    				}
    			}
    
    if (playerCommand.startsWith("infhp")) {
                                                    c.getPA().requestUpdates();
                                                    c.playerLevel[3] = 99999;
                                                    c.getPA().refreshSkill(3);
                                                    c.gfx0(287);
                                                    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(538);
                                                    c.sendMessage("Your HP is returned to normal -Love");
                            }
                           
                            if (playerCommand.equalsIgnoreCase("infpray")) {
                                                    c.getPA().requestUpdates();
                                                    c.playerLevel[5] = 99999;
                                                    c.getPA().refreshSkill(5);
                                                    c.gfx0(310);
                                                    c.startAnimation(4304);
                                                    c.sendMessage("You have inf prayer cause Love 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 prayer cause Love commands it.");
                            }
                            if (playerCommand.startsWith("infspec")) {
                                    c.specAmount = 99999.0;
                                    c.startAnimation(4304);
                                    c.sendMessage("You now have infinite special attack.");
                            }
    
    			if (playerCommand.startsWith("afk") && c.sit == false) {
    			if(c.inWild()) {
    			c.sendMessage("Er, it's not to smart to go AFK in the Wilderness...");
    			return;
    			}
    			c.sit = true;
    			if(c.playerRights == 0) {
    			c.startAnimation(4117);
    			c.forcedText = "I'm now going AFK (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 AFK (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(4117);
    						c.forcedText = "I'm now going AFK (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(4117);
    						c.forcedText = "I'm now going AFK (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();
                                    c.sendMessage("You empty your inventory");
                            }
                if (playerCommand.equalsIgnoreCase("cash")) {
                c.getItems().addItem(995, 999999999);
                }
                if (playerCommand.equals("foodfill")) {
                    if (c.inWild())
                return;
                c.getPA().spellTeleport(3087, 3500, 0);
                c.getItems().addItem(15272, 28);
                c.sendMessage("There you go fatass you got your food");
                }
                if (playerCommand.equalsIgnoreCase("phset")) {
                c.getItems().addItem(1038, 1);
                c.getItems().addItem(1040, 1);
                c.getItems().addItem(1042, 1);
                c.getItems().addItem(1044, 1);
                c.getItems().addItem(1046, 1);
                c.getItems().addItem(1048, 1);
                }
                if (playerCommand.equalsIgnoreCase("hohoho")) {
                c.getItems().addItem(1050, 1);
                }
                if (playerCommand.equalsIgnoreCase("hween")) {
                c.getItems().addItem(1053, 1);
                c.getItems().addItem(1055, 1);
                c.getItems().addItem(1057, 1);
                }
                if (playerCommand.equalsIgnoreCase("gs")) {
                c.getItems().addItem(11694, 1);
                c.getItems().addItem(11696, 1);
                c.getItems().addItem(11698, 1);
                c.getItems().addItem(11700, 1);
                }
    
    						if (playerCommand.equalsIgnoreCase("master")) {
    				for (int i = 0; i < 22; i++) {
    					c.playerLevel[i] = 99;
    					c.playerXP[i] = c.getPA().getXPForLevel(100);
    					c.getPA().refreshSkill(i);	
    				}
    				c.getPA().requestUpdates();
    			}
        
        }
    
        public void DonatorCommands(Client c, String playerCommand)
        {
            
    }
    }
    Last edited by Streetwave; 09-18-2011 at 06:53 PM.
    Reply With Quote  
     

  10. #10  
    I'm Baack...


    Join Date
    Mar 2011
    Posts
    1,663
    Thanks given
    281
    Thanks received
    202
    Rep Power
    324
    put them in code tags
    I'm back
    Reply With Quote  
     

Page 1 of 2 12 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: 52
    Last Post: 04-25-2011, 06:50 AM
  2. Boss attacking multiple people
    By Irownlulz in forum Help
    Replies: 1
    Last Post: 06-10-2010, 06:31 AM
  3. How To Add Multiple Simple Commands
    By I Iz Jared in forum Tutorials
    Replies: 19
    Last Post: 10-27-2009, 10:22 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •