Thread: Teleport Command (Ruse Base)

Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 38
  1. #21  
    Forum Moderator


    Join Date
    Dec 2016
    Posts
    312
    Thanks given
    166
    Thanks received
    177
    Rep Power
    1089
    Quote Originally Posted by DanTheGunGod View Post
    if(wholeCommand.toLowerCase().startsWith("dzone")) {
    TeleportHandler.teleportPlayer(player, new Position(3094, 3503), TeleportType.NORMAL);
    }
    give that a go
    This is a start, you'll still need quite a few checks. Check to see if a player is busy or not, check to see if a player is in the safe zone, check to see if they're frozen or not, etc.

    OT: Add my skype and i'll sort this out for you.
    Attached image
    Reply With Quote  
     

  2. #22  
    Registered Member
    Join Date
    Jul 2012
    Age
    25
    Posts
    122
    Thanks given
    16
    Thanks received
    21
    Rep Power
    15
    Quote Originally Posted by AnonLolAtWtf View Post
    I know some java, and that there is not the problem, literally here is the command before it. The placing is not wrong, and when i had "else if" it gives a ton of errors so that doesn't belong there but when i add just "if" it doesn't give errors.
    Code:
    	private static void playerCommands(Player player, String command, String[] parts) {
    		if(parts[0].startsWith("lockxp")) {
    			player.setExperienceLocked(!player.experienceLocked());
    			player.getPacketSender().sendMessage("Lock: "+player.experienceLocked());
    		} else if(parts[0].startsWith("empty")) {
    			player.getInventory().resetItems().refreshItems();
    				if (parts[0].equals("home")) {
    				player.getPacketSender().startTeleport(2905, 3611, 0, "modern");
    				player.getPacketSender().sendMessage("You teleport home.");
    			} 
    		} else if(parts[0].startsWith("veng")) {
    			if(player.busy()) {
    				player.getPacketSender().sendMessage("You cannot do that right now.");
    				return;
    			}
    			if(player.getInventory().getFreeSlots() < 3) {
    				player.getPacketSender().sendMessage("You don't have enough free inventory space to do that.");
    				return;
    			}
    			player.getInventory().add(9075, 1000).add(557, 1000).add(560, 1000);
    		} else if(parts[0].startsWith("barrage")) {
    			if(player.busy()) {
    				player.getPacketSender().sendMessage("You cannot do that right now.");
    				return;
    			}
    			if(player.getInventory().getFreeSlots() < 3) {
    				player.getPacketSender().sendMessage("You don't have enough free inventory space to do that.");
    				return;
    			}
    			player.getInventory().add(565, 1000).add(555, 1000).add(560, 1000);
    You're so arrogant and you have no clue what you're doing.
    It should be an else if and it should be moved outside. The placing is definitely the issue.
    Reply With Quote  
     

  3. #23  
    Registered Member
    Join Date
    May 2017
    Age
    25
    Posts
    222
    Thanks given
    2
    Thanks received
    5
    Rep Power
    0
    Quote Originally Posted by DanTheGunGod View Post
    if(wholeCommand.toLowerCase().startsWith("dzone")) {
    TeleportHandler.teleportPlayer(player, new Position(3094, 3503), TeleportType.NORMAL);
    }
    give that a go
    That didn't work either. :\

    Quote Originally Posted by Sarkastisk View Post
    You're so arrogant and you have no clue what you're doing.
    It should be an else if and it should be moved outside. The placing is definitely the issue.
    Well i got the command to work but it won't teleport. It's showing the display message.

    Quote Originally Posted by AnonLolAtWtf View Post
    That didn't work either. :\



    Well i got the command to work but it won't teleport. It's showing the display message.
    Anyone help pleaseeeee. it won't teleport.
    Reply With Quote  
     

  4. #24  
    Extreme Donator


    Join Date
    Aug 2016
    Posts
    597
    Thanks given
    109
    Thanks received
    96
    Rep Power
    254
    TeleportHandler.teleportPlayer(player, new Position(2273, 4681), player.getSpellbook().getTeleportType());
    Reply With Quote  
     

  5. #25  
    Banned

    Join Date
    May 2016
    Age
    55
    Posts
    1,137
    Thanks given
    565
    Thanks received
    600
    Rep Power
    0
    Code:
    if (wholeCommand.equalsIgnoreCase("home")) {
    TeleportHandler.teleportPlayer(player, new Position(3103, 3505, 0),
    player.getSpellbook().getTeleportType());
    }
    Place the code given right above the lockxp command.

    so it should end up looking like this;

    Code:
    private static void playerCommands(Player player, String command, String[] parts) {
                if (wholeCommand.equalsIgnoreCase("home")) {
                  TeleportHandler.teleportPlayer(player, new Position(3103, 3505, 0),
                   player.getSpellbook().getTeleportType());
                   }
    		  if(parts[0].startsWith("lockxp")) {
    			  player.setExperienceLocked(!player.experienceLocked());
    			   player.getPacketSender().sendMessage("Lock: "+player.experienceLocked());
    That may not work since your method is different than mine.

    let me know
    Reply With Quote  
     

  6. #26  
    Registered Member
    Join Date
    Jul 2012
    Age
    25
    Posts
    122
    Thanks given
    16
    Thanks received
    21
    Rep Power
    15
    Quote Originally Posted by AnonLolAtWtf View Post
    That didn't work either. :\



    Well i got the command to work but it won't teleport. It's showing the display message.



    Anyone help pleaseeeee. it won't teleport.
    Look at how the server handles other teleports. How does the startTeleport method in the packet sender look?
    Reply With Quote  
     

  7. #27  
    Donator


    Join Date
    Nov 2011
    Posts
    784
    Thanks given
    108
    Thanks received
    705
    Rep Power
    5000
    Quote Originally Posted by AnonLolAtWtf View Post
    Okay i have tried everything, i even made my own command for a teleport on my ruse based RSPS, and it wouldn't teleport, i even looked on google and theres no tutorial, can someone explain how to make a teleport command for RUSE based RSPS's?
    Under private static void playerCommands(final Player player, String[] command, String wholeCommand) {

    Add:
    Code:
    if (command[0].equalsIgnoreCase("home")) {
    			TeleportHandler.teleportPlayer(player, new Position(2905, 3611), player.getSpellbook().getTeleportType());
    }
    Reply With Quote  
     

  8. #28  
    Respected Member


    Kris's Avatar
    Join Date
    Jun 2016
    Age
    26
    Posts
    3,638
    Thanks given
    820
    Thanks received
    2,642
    Rep Power
    5000
    26 comments and you still haven't figured out how to write a god damn command.
    This kid's going to places.
    Attached image
    Reply With Quote  
     

  9. Thankful users:


  10. #29  
    Registered Member
    Join Date
    Feb 2016
    Posts
    123
    Thanks given
    32
    Thanks received
    31
    Rep Power
    68
    Quote Originally Posted by AnonLolAtWtf View Post
    I don't know what to replace it with?? That's what i'm needing help with.
    Post your commands class in something like pastebin.com
    Reply With Quote  
     

  11. #30  
    Donator


    Join Date
    Sep 2015
    Age
    24
    Posts
    532
    Thanks given
    68
    Thanks received
    115
    Rep Power
    414
    Lol really.. all of these members can't fix a command issue

    OT: I'm not into 317 however I've checked the code you have the commands working like

    you can't have it like

    Code:
    if (command 1) {
    
    } else if ( command 2) { 
    
    } if ( commnad 3) { 
    
    }
    so make it look like
    Code:
     if ( command 1) {
    
    } else if (command 2) {
    
    } else if (command 3) { 
    
    }
    you should re write commands class and use switch case is a lot better =/
    Reply With Quote  
     

Page 3 of 4 FirstFirst 1234 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. Replies: 4
    Last Post: 02-08-2018, 09:38 AM
  2. Zulrah Teleport Ruse Base
    By Vision_ in forum Help
    Replies: 0
    Last Post: 09-29-2017, 01:55 PM
  3. Ruse Based Server mypos command
    By Ghost1344 in forum Help
    Replies: 4
    Last Post: 08-03-2017, 12:11 AM
  4. teleport tab lagg[ruse base]
    By DelusionPS in forum Help
    Replies: 2
    Last Post: 11-18-2016, 08:39 PM
  5. Teleport Commands explained
    By Frost in forum Tutorials
    Replies: 3
    Last Post: 08-11-2007, 06:46 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •