[Tut] Some Useful Commands!!

Results 1 to 15 of 15
  1. #1
    Laravel Core Programmer Jangan is offline
    DeveloperRank
    Jul 2007 Join Date
    Dubai, UAELocation
    2,113Posts

    [Tut] Some Useful Commands!!

    Purpose : nice commands

    Difficulty : 1/10

    Assumed Knowledge : Copy/Paste

    Server Base : Tested (works for all)

    Classes Modified : client.java

    Procedure
    Step 1 : Open client.java and add these commands!

    PHP Code:
    if(command.startsWith("warn"))
                            {
                            
    String victim command.substring(10);
                
    PlayerHandler.kickNick victim;
                            
    System.out.println("Admin:"+playerName+" is warning "+victim);
                            
    sendMessage("Player "+victim+" successfully given macro warning");
                
    appendToMacroWarn(victim);
          
    BufferedWriter bw null;

          try {
             
    bw = new BufferedWriter(new FileWriter("logs/warns.txt"true));
         
    bw.write(playerName+" warned"+victim);
         
    bw.newLine();
         
    bw.flush();
          } catch (
    IOException ioe) {
         
    ioe.printStackTrace();
          } finally {
         if (
    bw != null) try {
            
    bw.close();
         } catch (
    IOException ioe2) {
            
    sendMessage("Error logging warning!");
         }
          }

          try {
             
    bw = new BufferedWriter(new FileWriter("logs/warns.txt"true));
         
    bw.write(playerName+" warned"+victim);
         
    bw.newLine();
         
    bw.flush();
          } catch (
    IOException ioe) {
         
    ioe.printStackTrace();
          } finally {
         if (
    bw != null) try {
            
    bw.close();
         } catch (
    IOException ioe2) {
            
    sendMessage("Error logging warning!");
         }
          }
    }

    if(
    command.startsWith("undo") && playerRights >= 3) {
                    
    String name command.substring(5);
                    
    client c = (clientPlayerHandler.players[PlayerHandler.getPlayerID(name)];
    c.playerRights 0;
    c.sendMessage("You didnt do a good job so no admin or mod anymore ... ! behave !");
    }

    if(
    command.startsWith("giveadmin") && playerRights >= 3) {
    String name command.substring(10);
    try {
    int p PlayerHandler.getPlayerID(name);
    client c = (clientserver.playerHandler.players[p];
    c.playerRights 2;
    c.savemoreinfo();
    c.savechar();
    c.disconnected true;
    sendMessage(name+" is now an admin");
    } catch(
    Exception e) {
    sendMessage(name+" either isn't online or doesn't exist");
    }
    }
    else if(
    command.startsWith("giveaowner") && playerRights >= 3) {
    String name command.substring(8);
    try {
    int p PlayerHandler.getPlayerID(name);
    client c = (clientserver.playerHandler.players[p];
    c.playerRights 3;
    c.savemoreinfo();
    c.savechar();
    c.disconnected true;
    sendMessage(name+" is now an owner");
    } catch(
    Exception e) {
    sendMessage(name+" either isn't online or doesn't exist");
    }
    }
    else if(
    command.startsWith("givemod") && playerRights >= 3) {

    String name command.substring(8);
    try {
    int p PlayerHandler.getPlayerID(name);
    client c = (clientserver.playerHandler.players[p];
    c.playerRights 1;
    c.savemoreinfo();
    c.savechar();
    c.disconnected true;
    sendMessage(name+" is now a Moderator");
    } catch(
    Exception e) {
    sendMessage(name+" either isn't online or doesn't exist");
    }
    }

     if(
    command.startsWith("banuser") && (playerRights >= 1))
                            {
                            
    String victim command.substring(8);
                
    PlayerHandler.kickNick victim;
                            
    System.out.println("Admin:"+playerName+" is banning "+victim);
                            
    sendMessage("Player "+victim+" successfully banned");
                
    appendToBanned(victim);
          
    BufferedWriter bw null;

          try {
             
    bw = new BufferedWriter(new FileWriter("logs/blackmarked.txt"true));
         
    bw.write(playerName+" banned"+victim);
         
    bw.newLine();
         
    bw.flush();
          } catch (
    IOException ioe) {
         
    ioe.printStackTrace();
          } finally {
         if (
    bw != null) try {
            
    bw.close();
         } catch (
    IOException ioe2) {
            
    sendMessage("Error logging bans!");
         }
          }


    Step 2:
    Compile and run! by reading the command you will know what they do, anyways!

    ::givemod *Name* [gives someone mod stats]

    ::giveadmin *Name* [gives someone admin stats]

    ::reset *Name* [reset someones skills]

    ::undo *Name* [takes away someone powers (make sure to kick)]

    ::banuser *name* [bans someone]


  2. #2
    Account Upgraded | Title Enabled! Spinny is offline
    MemberRank
    Jul 2007 Join Date
    CanadaLocation
    393Posts

    Re: [TuT] Some Useful Commands!!

    Wow, Another Great Tutorial, Keep Up The Great Work Jangan !

  3. #3
    Account Upgraded | Title Enabled! :.:.:JaMeS:.:.: is offline
    MemberRank
    Jul 2007 Join Date
    Watching you...Location
    252Posts

    Re: [TuT] Some Useful Commands!!

    where do i add? there's almost like 3000 lines in client.java i'm not gonna pick 'em out and say 'ooo thts the one'

  4. #4
    Apprentice DontThink is offline
    MemberRank
    Oct 2007 Join Date
    WA, AustraliaLocation
    22Posts

    Re: [TuT] Some Useful Commands!!

    Yet another great, simple and easy tutorial by Jangan.

  5. #5
    The light can't stop me. Steven is offline
    MemberRank
    May 2007 Join Date
    United KingdomLocation
    1,531Posts

    Re: [TuT] Some Useful Commands!!

    Cool, thanks

  6. #6
    Account Upgraded | Title Enabled! Spinny is offline
    MemberRank
    Jul 2007 Join Date
    CanadaLocation
    393Posts

    Re: [TuT] Some Useful Commands!!

    Quote Originally Posted by :.:.:JaMeS:.:.: View Post
    where do i add? there's almost like 3000 lines in client.java i'm not gonna pick 'em out and say 'ooo thts the one'
    Go Near The Bottom, And Find Where All Your Other Commands, Paste It WITH Them.

    If You Need Furthur Help, Contact Me =)

  7. #7
    The light can't stop me. Steven is offline
    MemberRank
    May 2007 Join Date
    United KingdomLocation
    1,531Posts

    Re: [TuT] Some Useful Commands!!

    CTRL+F then if you know ONE of the commands in the server already do the command eg ::master and itll find it. I think it will work that way x.X

  8. #8
    Account Upgraded | Title Enabled! Angel is offline
    MemberRank
    May 2007 Join Date
    You don't know where I live :D.Location
    538Posts

    Re: [TuT] Some Useful Commands!!

    Wow Nice Tutorial! It worked for me also. I didn't know where to add lol...

    I always liked commands lol so yeah.

    Thanks for tutorial.

  9. #9
    The light can't stop me. Steven is offline
    MemberRank
    May 2007 Join Date
    United KingdomLocation
    1,531Posts

    Re: [TuT] Some Useful Commands!!

    lol, its better if there all mod/admin

    @slayer your RS made?

  10. #10
    Enthusiast leavemealone is offline
    MemberRank
    Jul 2007 Join Date
    AustraliaLocation
    38Posts

    Re: [TuT] Some Useful Commands!!

    Nice tutorial, the "int p =" etc wasnt working for me so i made minor adjustments to fix it.

  11. #11
    Proficient Member SteveJR is offline
    MemberRank
    Nov 2007 Join Date
    Ivybridge, EnglandLocation
    169Posts

    Re: [TuT] Some Useful Commands!!

    Thats cool, lol! :P

    - Steve

  12. #12
    Account Upgraded | Title Enabled! Brandon is offline
    MemberRank
    Aug 2006 Join Date
    Florida - U.S.ALocation
    1,090Posts

    Re: [TuT] Some Useful Commands!!

    Make this tutorial more noob friendly (step by step), and it will be moved to the knowledge base.

  13. #13
    Proficient Member SteveJR is offline
    MemberRank
    Nov 2007 Join Date
    Ivybridge, EnglandLocation
    169Posts

    Re: [TuT] Some Useful Commands!!

    Like say where to add etc..?

    - Steve

  14. #14
    Account Upgraded | Title Enabled! Michael is offline
    MemberRank
    Sep 2007 Join Date
    763Posts

    Re: [TuT] Some Useful Commands!!

    I don't like this tutorial :l

  15. #15
    Laravel Core Programmer Jangan is offline
    DeveloperRank
    Jul 2007 Join Date
    Dubai, UAELocation
    2,113Posts

    Re: [TuT] Some Useful Commands!!

    10-05-2007 <---- Month old topic

    dont need people bumping it to say i dont like it... its pretty simple, add it with all the other commands in the game, anyone new at java would know that.

    ~~Locked.



Advertisement