Welcome, guest! Please login or register.

    * Shoutbox

    RefreshHistory
    • ragnoroker: Brand new server! Less than 1 week old! Nightmare/Raids 1/2/Hydra/Pk Modes/Exp modes/ Unique  Join today - [link]
      July 04, 2020, 06:42:38 PM
    • ragnoroker: Brand new server! Less than 1 week old! Nightmare/Raids 1/2/Hydra/Pk Modes/Exp modes/ Unique  Join today - [link]
      July 04, 2020, 06:42:32 PM
    • iddsyou: PkOwnage 2 worlds, modern OSRS & 2014 server! [link]  Join us on Discord! [link]
      July 04, 2020, 11:07:29 AM
    • slayerpure: kingdom full blown custom server with over 50 custom bosses released last week. play now here     [link]
      July 02, 2020, 08:44:32 PM
    • jgoet: dodian !!
      July 02, 2020, 07:15:44 PM
    • jgoet: join [link]  its back online !!!!
      July 02, 2020, 07:15:37 PM
    • Protojae: RIP moparscape
      July 02, 2020, 03:01:32 PM
    • Protojae: obviously thiswebsite is dead as fudge
      July 02, 2020, 03:01:14 PM
    • ragnoroker: RuneGuild has just been released! 1 Hour old, Come join the fun - [link]
      June 26, 2020, 02:14:21 PM
    • ragnoroker: RuneGuild has just been released! 1 Hour old, Come join the fun - [link]
      June 26, 2020, 02:14:08 PM
    • ragnoroker: RuneGuild has just been released! 1 Hour old, Come join the fun - [link]
      June 26, 2020, 02:14:00 PM
    • Fox2007: rune-nexus.com - FREE advertising, SEO optimized - no registration required
      June 26, 2020, 06:21:47 AM
    • Decimate Returns: trailer video posted for Project Decimate, Official Launch is in a few weeks! watch here: [youtube]LBorsdI-k1Y[/youtube]
      June 24, 2020, 07:18:03 PM
    • slayerpure: 1 week old rsps we need players and potential staff, customs and goku/vegeta sets play here!    [link] join our discord [link]
      June 24, 2020, 05:23:46 PM
    • Decimate Returns: Project Decimate is still in BETA: join our discord to keep up with the new content added: [link]
      June 24, 2020, 01:09:23 PM
    • Decimate Returns: Project Decimate is still in BETA: join our discord to keep up with the new content added: [link]
      June 24, 2020, 01:09:03 PM
    • dan v jad: PkOwnage OSRS Great server great community!  Join us on Discord! [link]  Download: [link]
      June 21, 2020, 09:23:28 AM
    • Lens: Sick Custom RSPS - CrystalPS. Join us on Discord. [link]
      June 20, 2020, 04:35:44 PM
    • Shady Aftermath: check out skyfire317.com gott 3 custom skills, afk zones
      June 19, 2020, 10:22:22 PM
    • Shady Aftermath: check out skyfire317.com gott 3 custom skills, afk zones
      June 19, 2020, 10:22:14 PM

    Author Topic: help with commands  (Read 1075 times)

    0 Members and 1 Guest are viewing this topic.

    Offlinewilliams15

    • Member
    • ***
    • Posts: 175
    • Thanks: +0/-0
      • View Profile
    help with commands
    « on: May 27, 2016, 06:51:41 AM »
    hi, everytime i add a command it gives me errors? the code for the commands fine, i think it might be some bug in script or somthing?

    Code: [Select]
    src\server\model\players\packets\Commands.java:743: error: illegal start of expression
            public void moderatorCommands(Client c, String playerCommand) {
            ^
    src\server\model\players\packets\Commands.java:743: error: illegal start of expression
            public void moderatorCommands(Client c, String playerCommand) {
                   ^
    src\server\model\players\packets\Commands.java:743: error: ';' expected
            public void moderatorCommands(Client c, String playerCommand) {
                                         ^
    src\server\model\players\packets\Commands.java:743: error: ';' expected
            public void moderatorCommands(Client c, String playerCommand) {
                                                          ^
    src\server\model\players\packets\Commands.java:743: error: not a statement
            public void moderatorCommands(Client c, String playerCommand) {
                                                           ^
    src\server\model\players\packets\Commands.java:743: error: ';' expected
            public void moderatorCommands(Client c, String playerCommand) {
                                                                        ^
    src\server\model\players\packets\Commands.java:902: error: illegal start of expression
            public void administratorCommands(Client c, String playerCommand) {
            ^
    src\server\model\players\packets\Commands.java:902: error: illegal start of expression
            public void administratorCommands(Client c, String playerCommand) {
                   ^
    src\server\model\players\packets\Commands.java:902: error: ';' expected
            public void administratorCommands(Client c, String playerCommand) {
                                             ^
    src\server\model\players\packets\Commands.java:902: error: ';' expected
            public void administratorCommands(Client c, String playerCommand) {
                                                              ^
    src\server\model\players\packets\Commands.java:902: error: not a statement
            public void administratorCommands(Client c, String playerCommand) {
                                                               ^
    src\server\model\players\packets\Commands.java:902: error: ';' expected
            public void administratorCommands(Client c, String playerCommand) {
                                                                            ^
    src\server\model\players\packets\Commands.java:998: error: illegal start of expression
            public void ownerCommands(Client c, String playerCommand) {
            ^
    src\server\model\players\packets\Commands.java:998: error: illegal start of expression
            public void ownerCommands(Client c, String playerCommand) {
                   ^
    src\server\model\players\packets\Commands.java:998: error: ';' expected
            public void ownerCommands(Client c, String playerCommand) {
                                     ^
    src\server\model\players\packets\Commands.java:998: error: ';' expected
            public void ownerCommands(Client c, String playerCommand) {
                                                      ^
    src\server\model\players\packets\Commands.java:998: error: not a statement
            public void ownerCommands(Client c, String playerCommand) {
                                                       ^
    src\server\model\players\packets\Commands.java:998: error: ';' expected
            public void ownerCommands(Client c, String playerCommand) {
                                                                    ^
    src\server\model\players\packets\Commands.java:1545: error: illegal start of expression
            private void serverSupportCommands(Client c, String playerCommand) {
            ^
    src\server\model\players\packets\Commands.java:1545: error: illegal start of expression
            private void serverSupportCommands(Client c, String playerCommand) {
                    ^
    src\server\model\players\packets\Commands.java:1545: error: ';' expected
            private void serverSupportCommands(Client c, String playerCommand) {
                                              ^
    src\server\model\players\packets\Commands.java:1545: error: ';' expected
            private void serverSupportCommands(Client c, String playerCommand) {
                                                               ^
    src\server\model\players\packets\Commands.java:1545: error: not a statement
            private void serverSupportCommands(Client c, String playerCommand) {
                                                                ^
    src\server\model\players\packets\Commands.java:1545: error: ';' expected
            private void serverSupportCommands(Client c, String playerCommand) {
                                                                             ^
    src\server\model\players\packets\Commands.java:1622: error: illegal start of expression
            public void donatorCommands(Client c, String playerCommand) {
            ^
    src\server\model\players\packets\Commands.java:1622: error: illegal start of expression
            public void donatorCommands(Client c, String playerCommand) {
                   ^
    src\server\model\players\packets\Commands.java:1622: error: ';' expected
            public void donatorCommands(Client c, String playerCommand) {
                                       ^
    src\server\model\players\packets\Commands.java:1622: error: ';' expected
            public void donatorCommands(Client c, String playerCommand) {
                                                        ^
    src\server\model\players\packets\Commands.java:1622: error: not a statement
            public void donatorCommands(Client c, String playerCommand) {
                                                         ^
    src\server\model\players\packets\Commands.java:1622: error: ';' expected
            public void donatorCommands(Client c, String playerCommand) {
                                                                      ^
    src\server\model\players\packets\Commands.java:1634: error: reached end of file while parsing
    }
     ^
    31 errors
    Press any key to continue . . .


    this is what i get when i add a whole new command when i remove that command again, it compiles properly ?
    :);):P ;P
    Runescape Gambling

    OfflineX-J-K-X

    • Member
    • ****
    • Posts: 1,951
    • Thanks: +0/-0
      • View Profile
    Re: help with commands
    « Reply #1 on: May 27, 2016, 07:37:05 AM »
    You missed a bracket at the end of the command, and make sure you're putting it in the right place

    Offlinewilliams15

    • Member
    • ***
    • Posts: 175
    • Thanks: +0/-0
      • View Profile
    Re: help with commands
    « Reply #2 on: May 28, 2016, 08:08:18 AM »
    You missed a bracket at the end of the command, and make sure you're putting it in the right place
    can you show me where it needs to be :P cant seem to fix the problem
    :);):P ;P

    Offlinesk8rdude461

    • MOPARSCAPE WAS HACKED
    • Member
    • ****
    • *
    • Posts: 12,471
    • Thanks: +0/-0
      • View Profile
    Re: help with commands
    « Reply #3 on: May 28, 2016, 11:30:51 PM »
    You missed a bracket at the end of the command, and make sure you're putting it in the right place
    can you show me where it needs to be :P cant seem to fix the problem
    Not without seeing the command you're trying to add along side the rest of the file.

    This is also something basic that you should learn to figure out. Take the command you're attempting to add, paste it into like Notepad++ or whatever editor you're using.
    (I highly recommend an IDE or at least Notepad++)
    You can use Rich Text Editors like Notepad++ to highlight the Java syntax (By changing the language to Java), which helps immensely here as you're going to need the highlighting.
    Place your cursor at the first open bracket for the command ( { ). Now since your cursor is on the first one, it should highlight the end bracket it's connected to. The very first start bracket should also be connected to the very last end bracket. Everything else should be in the middle of the two. If it's not like that, well, there's your issue.

    Offlinewilliams15

    • Member
    • ***
    • Posts: 175
    • Thanks: +0/-0
      • View Profile
    Re: help with commands
    « Reply #4 on: May 29, 2016, 01:24:54 AM »
    fix the error above ^
    my command in admin commands for spawning doesnt work ? it only works in player commands which anyone can use then
    Code: [Select]
    }
    if (playerCommand.startsWith("item")) {
    try {
    String[] args = playerCommand.split(" ");
    if (args.length == 3) {
    int newItemID = Integer.parseInt(args[1]);
    int newItemAmount = Integer.parseInt(args[2]);
    if ((newItemID <= 25000) && (newItemID >= 0)) {
    c.getItems().addItem(newItemID, newItemAmount);
    } else {
    c.sendMessage("That item ID does not exist.");
    }
    } else {
    c.sendMessage("Wrong usage: (Ex:(::pickup_ID_Amount)(::item 995 1))");
    }
    } catch(Exception e) {

    }
    }
    :);):P ;P

    Offlinesk8rdude461

    • MOPARSCAPE WAS HACKED
    • Member
    • ****
    • *
    • Posts: 12,471
    • Thanks: +0/-0
      • View Profile
    Re: help with commands
    « Reply #5 on: May 29, 2016, 02:01:48 AM »
    Well, in that code you've provided. you have an extra end bracket at the top.
    Code: Java
    1. if(playerCommand.startsWith("item")){
    2.         try{
    3.                 String[] args = playerCommand.split(" ");
    4.                 if(args.length==3){
    5.                         int newItemID =Integer.parseInt(args[1]);
    6.                         int newItemAmount =Integer.parseInt(args[2]);
    7.                         if((newItemID <=25000)&&(newItemID >=0)){
    8.                                 c.getItems().addItem(newItemID, newItemAmount);        
    9.                         }else{
    10.                                 c.sendMessage("That item ID does not exist.");
    11.                         }
    12.                 }else{
    13.                         c.sendMessage("Wrong usage: (Ex:(::pickup_ID_Amount)(::item 995 1))");
    14.                 }
    15.         }catch(Exception e){
    16.  
    17.         }
    18. }
    Is your full command.

     

    Copyright © 2017 MoparScape. All rights reserved.
    Powered by SMFPacks SEO Pro Mod |
    SimplePortal 2.3.5 © 2008-2012, SimplePortal