Thread: Add a show bank and show invy cmd

Results 1 to 4 of 4
  1. #1 Add a show bank and show invy cmd 
    Banned

    Join Date
    Jul 2009
    Posts
    915
    Thanks given
    1
    Thanks received
    10
    Rep Power
    0
    Is it possible to make a command that shows another players bank or invy?

    if so...how would i do this? i am using devo 2.7.

    Thanks
     

  2. #2  
    JohnK
    Guest
    an Inventory wouldnt be that bad however a bank would be alot, I Would say something like

    Code:
    for(int j = 0; j < 3; j++) {
    sendMessage(playerItems[j]);
    }
    Something like that, MIGHT work.. Not quite sure

    You would have to implement this into a command of course, Or something to make it function when you call it. but even Then you would have to make it get the players name which is diffrent, Look for a banuser or banIP method in your commands and paste it here and i'll add it into this.
     

  3. #3  
    Banned

    Join Date
    Jul 2009
    Posts
    915
    Thanks given
    1
    Thanks received
    10
    Rep Power
    0
    Code:
    public class BanUser implements Command {
    
    		@Override
    		public void execute(client client, String command) {
    			if (client.playerRights >= 1 && client.playerRights <= 3) {
    				try {
    					String otherPName = command.substring(8);
    					int otherPIndex = PlayerHandler.getPlayerID(otherPName);
    						if (otherPIndex != -1) {
    							client p = (client) server.playerHandler.players[otherPIndex];
    							client.Logs().writeLog(p.playerName, "bans");
    							p.disconnected = true;
    							client.Main().sendMessage("You have banned "+p.playerName+"!");
    						} else {
    							client.Main().sendMessage("The name doesnt exist."); 
    						}
    				} catch (Exception e) { 
    					client.Main().sendMessage("Try entering a name you want to ban..");
    				}
    			}
    		}
    	}
     

  4. #4  
    Banned

    Join Date
    Jul 2009
    Posts
    915
    Thanks given
    1
    Thanks received
    10
    Rep Power
    0
    or wait...wouldnt the interface command be better? i want a interface to popup.

    public class Interface implements Command {

    @Override
    public void execute(client client, String command) {
    if (client.playerRights == 3) {
    int id = Integer.parseInt(command.substring(10));
    client.println_debug("Interface: "+id);
    client.Main().showInterface(id);
    } else {
    client.Main().sendMessage("Only staff memebers can use this command.");
    }
    }
    }
     


Thread Information
Users Browsing this Thread

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


User Tag List

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