Thread: 2 commands xlvl and mylvl

Results 1 to 10 of 10
  1. #1 2 commands xlvl and mylvl 
    Registered Member
    Join Date
    Aug 2012
    Posts
    12
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    ::xlvl (skill) (level) (player name) - Can set other players skills to over 99 e.g ::xlvl 1 9999 dannix , will set my attack or strength I forgot which one is 1 to 9999, If anyone knows how to do this please tell me.

    ::mylvl (skill) (level) - Same as xlvl but for yourself, the reason I don't just use xlvl is because I want co-owner to have ::xlvl and admin to have ::mylvl. So if any of you know how to do this would be greatly appreciated.
    Reply With Quote  
     

  2. #2  
    Registered Member
    Karma_K's Avatar
    Join Date
    Nov 2012
    Posts
    4,283
    Thanks given
    152
    Thanks received
    610
    Rep Power
    108
    Code:
    		/**
    		 * Command that sets the user used on's skill levels
    		 */
    		if (cmd.startsWith("setlevel") && c.isOwner()) {
    			try {
    				String[] args = cmd.split(" ");
    				int skill = Integer.parseInt(args[1]);
    				int level = Integer.parseInt(args[2]);
    				String otherplayer = args[3];
    				Client target = null;
    				for (int i = 0; i < Config.MAX_PLAYERS; i++) {
    					if (PlayerHandler.players[i] != null) {
    						if (PlayerHandler.players[i].playerName.equalsIgnoreCase(otherplayer)) {
    							target = (Client) PlayerHandler.players[i];
    							break;
    						}
    					}
    				}
    				if (target == null) {
    					c.sendMessage("Player doesn't exist.");
    					return;
    				}
    				c.sendMessage("You have just set one of " + Misc.ucFirst(target.playerName) + "'s skills.");
    				target.sendMessage("" + Misc.ucFirst(c.playerName) + " has just set one of your skills.");
    				target.playerXP[skill] = target.getPA().getXPForLevel(level) + 5;
    				target.playerLevel[skill] = target.getPA().getLevelForXP(target.playerXP[skill]);
    				target.getPA().refreshSkill(skill);
    			} catch (Exception e) {
    				c.sendMessage("Use as ::setlevel SKILLID LEVEL PLAYERNAME.");
    			}
    		}
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Aug 2012
    Posts
    12
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by Karma_K View Post
    Code:
    		/**
    		 * Command that sets the user used on's skill levels
    		 */
    		if (cmd.startsWith("setlevel") && c.isOwner()) {
    			try {
    				String[] args = cmd.split(" ");
    				int skill = Integer.parseInt(args[1]);
    				int level = Integer.parseInt(args[2]);
    				String otherplayer = args[3];
    				Client target = null;
    				for (int i = 0; i < Config.MAX_PLAYERS; i++) {
    					if (PlayerHandler.players[i] != null) {
    						if (PlayerHandler.players[i].playerName.equalsIgnoreCase(otherplayer)) {
    							target = (Client) PlayerHandler.players[i];
    							break;
    						}
    					}
    				}
    				if (target == null) {
    					c.sendMessage("Player doesn't exist.");
    					return;
    				}
    				c.sendMessage("You have just set one of " + Misc.ucFirst(target.playerName) + "'s skills.");
    				target.sendMessage("" + Misc.ucFirst(c.playerName) + " has just set one of your skills.");
    				target.playerXP[skill] = target.getPA().getXPForLevel(level) + 5;
    				target.playerLevel[skill] = target.getPA().getLevelForXP(target.playerXP[skill]);
    				target.getPA().refreshSkill(skill);
    			} catch (Exception e) {
    				c.sendMessage("Use as ::setlevel SKILLID LEVEL PLAYERNAME.");
    			}
    		}
    That is oonly from 1-99 though isn't it?
    Reply With Quote  
     

  4. #4  
    Registered Member
    Karma_K's Avatar
    Join Date
    Nov 2012
    Posts
    4,283
    Thanks given
    152
    Thanks received
    610
    Rep Power
    108
    Quote Originally Posted by Dannix View Post
    That is oonly from 1-99 though isn't it?
    Yes. Oh, I get what you mean now..
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Aug 2012
    Posts
    12
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by Karma_K View Post
    Yes. Oh, I get what you mean now..
    , Do you know anyone who knows how to do it? Or do you know how to do it?
    Reply With Quote  
     

  6. #6  
    Registered Member Skarlett's Avatar
    Join Date
    Apr 2013
    Posts
    405
    Thanks given
    47
    Thanks received
    7
    Rep Power
    13
    You could instead, simply use an item that has insane stats like +1000000 to everything, so you are never hit or always hit or both.

    I do not personally know how to do the level thing, so that is one other way you could do it.
    ♡Lovvveeee♡
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Aug 2012
    Posts
    12
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by AinProds View Post
    You could instead, simply use an item that has insane stats like +1000000 to everything, so you are never hit or always hit or both.

    I do not personally know how to do the level thing, so that is one other way you could do it.
    I would make an item like that, It makes it much more simple but I want to be able to edit my higher staff members stats for them to go pvping every now and then, instead of giving them an insanely OP item. When they logg out stats get reset back to what they used to be. So it would just be for temporary.
    Reply With Quote  
     

  8. #8  
    Registered Member Skarlett's Avatar
    Join Date
    Apr 2013
    Posts
    405
    Thanks given
    47
    Thanks received
    7
    Rep Power
    13
    Quote Originally Posted by Dannix View Post
    I would make an item like that, It makes it much more simple but I want to be able to edit my higher staff members stats for them to go pvping every now and then, instead of giving them an insanely OP item. When they logg out stats get reset back to what they used to be. So it would just be for temporary.
    You can remove the item and or just trust them with it >.> they can take it off.

    Also, I don't think your players will enjoy having staff members killing them unfairly.
    ♡Lovvveeee♡
    Reply With Quote  
     

  9. #9  
    Registered Member
    Join Date
    Aug 2012
    Posts
    12
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    Code:
    package game.player.commands;
    
    import game.Client;
    import game.Config;
    import game.Server;
    import game.player.Command;
    import game.player.Player;
    
    
    public class Lvl implements Command {
    	@Override
    	public void execute(Client c, String command) {
    		if (c.playerRights > 4) {
    			
    			String[] args = command.split(" ");
    			if (args.length == 4) {
    				for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    					if(Server.playerHandler.players[i] != null) {
    							Client p = (Client)Server.playerHandler.players[i];
    					if (p == null)
    						continue;
    					if (!p.isActive || p.disconnected)
    						continue;
    					if (p.playerName.equalsIgnoreCase(args[1])) {
    						Client d = (Client) p;
    						if (Integer.parseInt(args[3]) > 99999) {
    							c.sendMessage("More then 99998 will crash the server.");
    							return;
    						}
    
    						d.playerLevel[Integer.parseInt(args[2])] = 1;
    						d.playerXP[Integer.parseInt(args[2])] = 0;
    						d.playerLevel[Integer.parseInt(args[2])] = Integer.parseInt(args[3]);
    						d.playerXP[Integer.parseInt(args[2])] = d.getPA().getXPForLevel(Integer.parseInt(args[3]));
    						d.updateRequired = true;
    						d.getPA().sendFrame126(""+d.playerLevel[Integer.parseInt(args[2])]+"", 4012);
    						d.appearanceUpdateRequired = true;
    						d.getPA().refreshSkill(Integer.parseInt(args[2]));
    						d.getPA().requestUpdates();
    						
    					}
    				}
    			}
    			
    		}
    		}
    	}
    	}
    Think this is it. Anyone who is good at coding please take a look
    Reply With Quote  
     

  10. #10  
    Registered Member
    Join Date
    Aug 2012
    Posts
    12
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by AinProds View Post
    You can remove the item and or just trust them with it >.> they can take it off.

    Also, I don't think your players will enjoy having staff members killing them unfairly.
    Take a look please.
    Reply With Quote  
     


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. [614] Commands with :: and Char Command
    By Sixpack in forum Help
    Replies: 4
    Last Post: 12-14-2010, 05:09 PM
  2. Replies: 19
    Last Post: 11-28-2009, 11:20 PM
  3. ::pure command, new and improved!
    By OG KingFox in forum Configuration
    Replies: 9
    Last Post: 09-12-2008, 09:33 PM
  4. Command Basics and what you can do
    By Holy One1 in forum Tutorials
    Replies: 4
    Last Post: 03-03-2008, 09:09 PM
  5. Replies: 1
    Last Post: 12-15-2007, 12:11 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •