Thread: [Ruse] Command help

Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 23
  1. #11  
    Extreme Donator


    Join Date
    Aug 2016
    Posts
    597
    Thanks given
    109
    Thanks received
    96
    Rep Power
    254
    Quote Originally Posted by OmegaX View Post
    http://prntscr.com/jtvhzr
    That's the error in the line below, I have no idea... ahahaha
    You just sent the same exact picture. You should take a screenshot of what the actual error is. Hover over the red "x" or go to your problems log and post what the problems are. If it's not a missing bracket, then I can't tell because that picture doesn't help at all
    Reply With Quote  
     

  2. #12  
    Registered Member
    rebecca's Avatar
    Join Date
    Aug 2017
    Posts
    1,071
    Thanks given
    862
    Thanks received
    915
    Rep Power
    5000
    you are missing a lot of brackets in your if statement, did you even read Kris' comment
    Reply With Quote  
     

  3. #13  
    Registered Member
    Join Date
    Feb 2018
    Posts
    20
    Thanks given
    1
    Thanks received
    1
    Rep Power
    0
    Quote Originally Posted by Goody View Post
    You just sent the same exact picture. You should take a screenshot of what the actual error is. Hover over the red "x" or go to your problems log and post what the problems are. If it's not a missing bracket, then I can't tell because that picture doesn't help at all
    http://prntscr.com/jtwksv
    This is the line below, sorry I thought I posted a different screenshot
    Reply With Quote  
     

  4. #14  
    Registered Member
    rebecca's Avatar
    Join Date
    Aug 2017
    Posts
    1,071
    Thanks given
    862
    Thanks received
    915
    Rep Power
    5000
    could you copy paste the code inside code tags please, not the bottom part, tbh your ide should tell you
    that you're missing a bracket above
    Reply With Quote  
     

  5. #15  
    Extreme Donator


    Join Date
    Aug 2016
    Posts
    597
    Thanks given
    109
    Thanks received
    96
    Rep Power
    254
    If your code is unreachable, then you most likely have your next command (that if statement) underneath, directly underneath a return. You can't place code underneath a return because that code will never execute, hence "unreachable code".
    Reply With Quote  
     

  6. #16  
    Registered Member
    Join Date
    Feb 2018
    Posts
    20
    Thanks given
    1
    Thanks received
    1
    Rep Power
    0
    Code:
    if (command[0].equalsIgnoreCase("wildy2") || (player.getInventory().contains(15643) || player.getInventory().contains(15640) || player.getEquipment().contains(15643) || player.getEquipment().contains(15640))) {
    			player.getPacketSender().sendMessage("You can't take custom Armour/Weapons in here!");
    return;//this
    			} else {
    			TeleportHandler.teleportPlayer(player, new Position(3104, 5537), player.getSpellbook().getTeleportType());
    return;//this
    	}
    		
    		if (command[0].equalsIgnoreCase("abbadon")) {
    			TeleportHandler.teleportPlayer(player, new Position(2496, 5175, 0), player.getSpellbook().getTeleportType());
    
    		}
    http://prntscr.com/judkan
    http://prntscr.com/judkg1
    Reply With Quote  
     

  7. #17  
    Registered Member
    excl150's Avatar
    Join Date
    Jul 2014
    Posts
    123
    Thanks given
    46
    Thanks received
    30
    Rep Power
    97
    Quote Originally Posted by Goody View Post
    If your code is unreachable, then you most likely have your next command (that if statement) underneath, directly underneath a return. You can't place code underneath a return because that code will never execute, hence "unreachable code".
    Quote Originally Posted by OmegaX View Post
    Code:
    if (command[0].equalsIgnoreCase("wildy2") || (player.getInventory().contains(15643) || player.getInventory().contains(15640) || player.getEquipment().contains(15643) || player.getEquipment().contains(15640))) {
    			player.getPacketSender().sendMessage("You can't take custom Armour/Weapons in here!");
    return;//this
    			} else {
    			TeleportHandler.teleportPlayer(player, new Position(3104, 5537), player.getSpellbook().getTeleportType());
    return;//this
    	}
    		
    		if (command[0].equalsIgnoreCase("abbadon")) {
    			TeleportHandler.teleportPlayer(player, new Position(2496, 5175, 0), player.getSpellbook().getTeleportType());
    
    		}
    http://prntscr.com/judkan
    http://prntscr.com/judkg1
    What Goody said is exactly the case here, the first if checks a condition and if it doesn't match that condition it will always go to else and here you return out of the method meaning it can never reach the code below this return resulting in unreachable code. Try removing the return statements, change things around and see what happens
    Reply With Quote  
     

  8. #18  
    Registered Member
    Join Date
    Feb 2018
    Posts
    20
    Thanks given
    1
    Thanks received
    1
    Rep Power
    0
    Quote Originally Posted by excl150 View Post
    What Goody said is exactly the case here, the first if checks a condition and if it doesn't match that condition it will always go to else and here you return out of the method meaning it can never reach the code below this return resulting in unreachable code. Try removing the return statements, change things around and see what happens
    I've tried all of that dude, been messing with it for 2 days and everything just doesn't seem to work & when I finally don't have errors and I use the command, every other command like ::home for example, uses this command too...
    Reply With Quote  
     

  9. #19  
    Registered Member
    rebecca's Avatar
    Join Date
    Aug 2017
    Posts
    1,071
    Thanks given
    862
    Thanks received
    915
    Rep Power
    5000
    Quote Originally Posted by OmegaX View Post
    I've tried all of that dude, been messing with it for 2 days and everything just doesn't seem to work & when I finally don't have errors and I use the command, every other command like ::home for example, uses this command too...
    dude.. youve been working on a home command for 2 days? just give me your teamviewer and ill do it in 1 second
    Reply With Quote  
     

  10. #20  
    Registered Member
    Join Date
    Jul 2015
    Posts
    451
    Thanks given
    15
    Thanks received
    58
    Rep Power
    55
    Quote Originally Posted by OmegaX View Post
    http://prntscr.com/jtvhzr
    That's the error in the line below, I have no idea... ahahaha
    immortal x......................................
    Reply With Quote  
     

Page 2 of 3 FirstFirst 123 LastLast

Thread Information
Users Browsing this Thread

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


User Tag List

Similar Threads

  1. [Ruse] Need help with commands
    By SinfulPS in forum Help
    Replies: 6
    Last Post: 01-12-2017, 05:13 PM
  2. [Ruse] Commands help
    By Hell Kid in forum Help
    Replies: 14
    Last Post: 01-11-2016, 06:07 AM
  3. Replies: 52
    Last Post: 04-19-2009, 04:48 PM
  4. item commaND HELP
    By `Lubricant in forum Tutorials
    Replies: 6
    Last Post: 08-03-2008, 09:11 PM
  5. basic command help(short tut)
    By Sub in forum Tutorials
    Replies: 2
    Last Post: 11-07-2007, 08:38 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •