Thread: [Project 72] Handling commands into commands.java

Results 1 to 10 of 10
  1. #1 [Project 72] Handling commands into commands.java 
    Blair'
    Guest
    Okay, this is a little more advanced, just pay attention.
    • Step one
      Make a new txt file & save it as commands.java & save as all file types.
      Then add this inside of it

      Code:
      public class commands { 
      
      	
      
      public void command(int a){
      
      client p = (client) server.playerHandler.players[a];
      //Add new code below here
      
      
      }//DO NOT ADD CODE PAST HERE.
      }
    • Step two
      go into server.java & find
      Code:
      	public static cases cases = null;
      Under that add
      Code:
      	public static commands commands = null;
    • Step three
      Find
      Code:
      		cases = new cases();
      & Under that add
      Code:
      		commands = new commands();
    • Step four
      Open Client.java & find this
      Code:
      	private void customCommand(String command) {
      Copy everything in that into your new file betwwen the correct brackets. (between add below here & before here.)



      Your
      Code:
      private void customCommand(String command) {
      Should like this
      Code:
      private void customCommand(String command) {
      
      }
      Now replace that with

      Code:
      private void customCommand(String command) {
      server.commands.command(playerId);
      }
    • Last Step
      add p. infront of mostly everything like "sM" would be "p.sM"
      Post questions, & I'll be glad to answer them

      Example:
      Code:
      	if(command.equalsIgnoreCase("runes")) {
      
      	for(int i = 553; i < 567; i++) {
      
      addItem(i, 2147000000);
      
      }
      
      }
      Would be

      Code:
      	if(command.equalsIgnoreCase("runes")) {
      
      	for(int i = 553; i < 567; i++) {
      
      p.addItem(i, 2147000000);
      
      }
      
      }
      You only have to add p. infront of a method if it's located in client.java if it's delcared in the commands file you have no need to put a p. infront
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Jan 2009
    Age
    31
    Posts
    3,143
    Thanks given
    27
    Thanks received
    92
    Rep Power
    0
    Once again, change the [Project 72] to [Delta], this doesn't only work on your base.
    Reply With Quote  
     

  3. #3  
    Blair'
    Guest
    Quote Originally Posted by iYamiScape View Post
    Once again, change the [Project 72] to [Delta], this doesn't only work on your base.
    L2 read faggot, this is not deltascape. THIS tutorial may work on ANY server. But I made it for MY server. Which wL & Deltascape based. Now GTFO before I start reporting
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Jan 2009
    Age
    31
    Posts
    3,143
    Thanks given
    27
    Thanks received
    92
    Rep Power
    0
    Quote Originally Posted by Blair' View Post
    L2 read faggot, this is not deltascape. THIS tutorial may work on ANY server. But I made it for MY server. Which wL & Deltascape based. Now GTFO before I start reporting
    You're going to report me for making a mistake and not reading your other thread reply?
    You're the one flaming and calling me a faggot.
    Reply With Quote  
     

  5. #5  
    Registered Member

    Join Date
    Jun 2007
    Posts
    2,237
    Thanks given
    267
    Thanks received
    411
    Rep Power
    1283
    Code:
    private void customCommand(String command) {
    server.commands.command(playerId);
    }
    We have a winner.
    Don't worry, Be happy.
    Reply With Quote  
     

  6. #6  
    Blair'
    Guest
    Quote Originally Posted by daniel View Post
    Code:
    private void customcommand(string command) {
    server.commands.command(playerid);
    }
    we have a winner.
    ask me about my wiener.
    Reply With Quote  
     

  7. #7  
    Registered Member

    Join Date
    Nov 2008
    Posts
    2,180
    Thanks given
    148
    Thanks received
    99
    Rep Power
    2004
    lols Blair.. Nice i guess except the fact it takes 5 mins
    Reply With Quote  
     

  8. #8  
    Registered Member

    Join Date
    Jun 2007
    Posts
    2,237
    Thanks given
    267
    Thanks received
    411
    Rep Power
    1283
    Quote Originally Posted by Blair' View Post
    ask me about my wiener.
    How long is it?
    Alos I hoped you would see your mistake.
    customCommands is only called in a single spot. Instead of adding your command class be call in a method that is run when a packet is recieved just make it
    Code:
    case 103:// or what ever the command packet is
        server.commands.command(command, playerid);
    Don't worry, Be happy.
    Reply With Quote  
     

  9. #9  
    Blair'
    Guest
    Quote Originally Posted by Daniel View Post
    How long is it?
    Alos I hoped you would see your mistake.
    customCommands is only called in a single spot. Instead of adding your command class be call in a method that is run when a packet is recieved just make it
    Code:
    case 103:// or what ever the command packet is
        server.commands.command(command, playerid);
    Wasn't thinking
    People msn'd me woundering why it wasn't handled so I just added it asap
    Reply With Quote  
     

  10. #10  
    Blair'
    Guest
    bump
    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

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