Thread: making some commands, ::afk ::back, tele commands, additems, sendmessages. useful.

Page 1 of 2 12 LastLast
Results 1 to 10 of 20
  1. #1 making some commands, ::afk ::back, tele commands, additems, sendmessages. useful. 
    Human

    Only's Avatar
    Join Date
    Aug 2008
    Posts
    1,108
    Thanks given
    1
    Thanks received
    18
    Rep Power
    116
    Name of TuT: How to add commands too your pserver.
    Difficulty: 1/10 <- barely.
    What too do: Copy + paste (Ctrl + F)
    Credits: Me and only me, not very much too take credits for
    a little extra: Just if you want too talk to me live or ingame on my server the Address/IP is 0nlyscape.no-ip.org with a zero at start, and my email is: [Only registered and activated users can see links. ], report any errors or difficulties you get, if you have any. ( well duuuh )

    Okey first off all, im gonna teach you how to make custom commands which could either teleport you, give items or sendmessages, etc. and after how to add playerRights too them: That means you will have to have a certain ingame rank/status, 0 means player - 1 means mod - 2 means admin... etc. so that if you choose too have playerRights for the commands i will teach you how too do it. Lets start off with opening client.java, press ctrl + f and search for:

    Code:
    public void customCommand(String command) {
    under this you might see this:
    this is the code for ::afk
    Code:
    if (command.startsWith("afk")) {
    		  startAnimation(1353);
    		  updateRequired = true;
    		  appearanceUpdateRequired = true;
    		  txt4 = "didnt i mention? IM AFK!";
    		  string4UpdateRequired = true;
    		}
    This is the code for the command ::afk, you might wanna add this cause it comes in handy if your going to the toilet, watchin videos/coding etc...
    ann under here is ::back

    And here is the command to get back from ::afk... ::back
    Code:
    if (command.startsWith("back")) {
    		  startAnimation(1);
    		  updateRequired = true;
    		  appearanceUpdateRequired = true;
    		  txt4 = "im back in black!";
    		  string4UpdateRequired = true;		
    		}
    Now, its important you space it right if it isent already!

    Now ill just write how to add your own easy commands: just search for any command you already got, and find the bracket '}'
    after a command if you dont know how to already... the bracket -> '}' means that the code is ended and therefor you can add a new one after it.
    '{' means its opening the code... common sense really. okey, lets see. i think ive told the most already(if theres anything else, just contact me.)

    A command without playerRights ->
    Code:
    if (command.startsWith("Put in the name of command here")) {
    		  addItem(ItemID here, Amount here);
    		  sendMessage("Message to send when code is entered here");
    		  startAnimation(animationID / number here);
    }
    thats a regular command without any playerRights or extra hardcore stuff. Now, ill show a command code with playerRights ->
    Code:
    if (command.equalsIgnoreCase("command name here") && playerRights >= 0) {
    		  addItem(ItemID, Amount);
    		  startAnimation(animationID / Number here);
    		  sendMessage("Message here");
    }
    You can add more of the "addItems, sendmessages of course, if you want a food command it would be like this:

    Code:
    		if (command.equalsIgnoreCase("food") && playerRights >= 0) {
    			addItem(391, 28);
    			sendMessage("FOOD FTW");
    		}
    And this is the Teleport Command:

    Code:
    if (command.equalsIgnoreCase("command name here") && playerRights >= 0) {
    				teleportToX = Xcords here;
    				teleportToY = Ycords here;
    				heightLevel = 0;
    				sendMessage("Put your message here.");
    }
    (If theres anything else of commands or such you want me too give you, or post here, just Pm me or contact me at all.)
    this Tutorial was made by me and only me, i had some free time and i wanted to give something too the community newbeginners, etc. Have fun, and go code! Peace out.
    Code ftw.
    If i dont get any feedback or comments or anything at all, ill just remove, doesnt matter too much then... :/
    Last edited by Only; 09-06-2008 at 12:53 AM. Reason: Double posting is not allowed!
     

  2. #2  
    Human

    Only's Avatar
    Join Date
    Aug 2008
    Posts
    1,108
    Thanks given
    1
    Thanks received
    18
    Rep Power
    116
    thank you for commentz
     

  3. #3  
    andrej1349
    Guest
    thank you!
    (woooooot i got rune armor now)
     

  4. #4  
    Human

    Only's Avatar
    Join Date
    Aug 2008
    Posts
    1,108
    Thanks given
    1
    Thanks received
    18
    Rep Power
    116
    No problemo and no you didnt, you get that at 10 posts and you just have 8 xD ^
     

  5. #5  
    Member
    Join Date
    May 2007
    Posts
    44
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Nice, I'm going to use ::afk and ::back
    RunePK 508, coming very soon.

    PROUD OWNER OF RUNITEKINGDOM!

     

  6. #6  
    Human

    Only's Avatar
    Join Date
    Aug 2008
    Posts
    1,108
    Thanks given
    1
    Thanks received
    18
    Rep Power
    116
    thanks m8...
     

  7. #7  
    I Ain't Trippin Motha Fucka Roll A Jay

    Purp's Avatar
    Join Date
    Sep 2008
    Posts
    512
    Thanks given
    1
    Thanks received
    1
    Rep Power
    85
    Code:
    client.java:7606: cannot find symbol
    symbol  : variable txt4
    location: class client
                      txt4 = "didnt i mention? IM AFK!";
                      ^
    client.java:7607: cannot find symbol
    symbol  : variable string4UpdateRequired
    location: class client
                      string4UpdateRequired = true;
                      ^
    2 errors
    Finished!
    Press any key to continue . . .
    =\

    not tryin to be mean or anything but your server is kinda bad
    Last edited by Purp; 09-29-2008 at 05:10 AM. Reason: Double posting is not allowed!
    Owner of CivilScape
    http://www.rune-server.ee/f522/24-7-civilscape-24-7-t110852.html
     

  8. #8  
    The Godz
    Guest
    Quote Originally Posted by purp View Post
    Code:
    client.java:7606: cannot find symbol
    symbol  : variable txt4
    location: class client
                      txt4 = "didnt i mention? IM AFK!";
                      ^
    client.java:7607: cannot find symbol
    symbol  : variable string4UpdateRequired
    location: class client
                      string4UpdateRequired = true;
                      ^
    2 errors
    Finished!
    Press any key to continue . . .
    =\

    not tryin to be mean or anything but your server is kinda bad
    No, YOUR server is the bad one here, You dont have those variables.
     

  9. #9  
    Donator

    Pointzero's Avatar
    Join Date
    Jan 2008
    Posts
    548
    Thanks given
    1
    Thanks received
    2
    Rep Power
    86
    Quote Originally Posted by purp View Post
    Code:
    client.java:7606: cannot find symbol
    symbol  : variable txt4
    location: class client
                      txt4 = "didnt i mention? IM AFK!";
                      ^
    client.java:7607: cannot find symbol
    symbol  : variable string4UpdateRequired
    location: class client
                      string4UpdateRequired = true;
                      ^
    2 errors
    Finished!
    Press any key to continue . . .
    =\

    not tryin to be mean or anything but your server is kinda bad

    Add them variables, they will also come in handy in the futre.
    That will clear the errors.
    “If at first, the idea is not absurd, then there is no hope for it” - Albert Einstein
     

  10. #10  
    Human

    Only's Avatar
    Join Date
    Aug 2008
    Posts
    1,108
    Thanks given
    1
    Thanks received
    18
    Rep Power
    116
    My server aint that bad but its not good, because i dont use no time coding it, because im at this site helping peoples 24/7!!!
    And how can your server be any better when you dont have the txt4 vars lol ? ... If you cant do that yourself then dont bother doing this lol...
     

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

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