Thread: Commands disabled in a certain location

Results 1 to 6 of 6
  1. #1 Commands disabled in a certain location 
    Registered Member
    Zach's Avatar
    Join Date
    Aug 2013
    Posts
    1,120
    Thanks given
    24
    Thanks received
    513
    Rep Power
    5000
    How would one go about making it so commands can't be used within specific coordinates? I'm stumped here and I need it ASAP.
    ZachTX's RSPS Video Services (10,000+ Loyal RSPS Subscribers)
    CLICK HERE!

    Attached image
    Reply With Quote  
     

  2. #2  
    wat u gon do lol ¯\_(ツ)_/¯
    Nills's Avatar
    Join Date
    Feb 2013
    Posts
    339
    Thanks given
    82
    Thanks received
    36
    Rep Power
    54
    There should be a method checking if a player is within a certain area, so just make an if-statement checking if the player is in that area and if they are, return the statement.

    Example;

    Code:
    case "item":
    if (player.isInArea(new Worldtile(1,1,1)) { //obviously won't be correct, you have to find the method yourself 
    player.getPackets().sendGameMessage("You cannot use this command in here!");
    return;
    }
    //and if they aren't in the area and can use it:
    player.getInventory().addItem(995, 1000);
    break;
    Reply With Quote  
     

  3. #3  
    Registered Member
    Zach's Avatar
    Join Date
    Aug 2013
    Posts
    1,120
    Thanks given
    24
    Thanks received
    513
    Rep Power
    5000
    Quote Originally Posted by Nills View Post
    There should be a method checking if a player is within a certain area, so just make an if-statement checking if the player is in that area and if they are, return the statement.

    Example;

    Code:
    case "item":
    if (player.isInArea(new Worldtile(1,1,1)) { //obviously won't be correct, you have to find the method yourself 
    player.getPackets().sendGameMessage("You cannot use this command in here!");
    return;
    }
    //and if they aren't in the area and can use it:
    player.getInventory().addItem(995, 1000);
    break;
    I'm trying to make it so you can't use any commands at all in a certain area.
    ZachTX's RSPS Video Services (10,000+ Loyal RSPS Subscribers)
    CLICK HERE!

    Attached image
    Reply With Quote  
     

  4. #4  
    wat u gon do lol ¯\_(ツ)_/¯
    Nills's Avatar
    Join Date
    Feb 2013
    Posts
    339
    Thanks given
    82
    Thanks received
    36
    Rep Power
    54
    Quote Originally Posted by Zach_ View Post
    I'm trying to make it so you can't use any commands at all in a certain area.
    What base/protocol are you using?
    Reply With Quote  
     

  5. #5  
    Registered Member
    Zach's Avatar
    Join Date
    Aug 2013
    Posts
    1,120
    Thanks given
    24
    Thanks received
    513
    Rep Power
    5000
    Quote Originally Posted by Nills View Post
    What base/protocol are you using?
    Matrix 718
    ZachTX's RSPS Video Services (10,000+ Loyal RSPS Subscribers)
    CLICK HERE!

    Attached image
    Reply With Quote  
     

  6. #6  
    wat u gon do lol ¯\_(ツ)_/¯
    Nills's Avatar
    Join Date
    Feb 2013
    Posts
    339
    Thanks given
    82
    Thanks received
    36
    Rep Power
    54
    WorldPacketsDecoder

    Search for
    Code:
    if (message.startsWith("::") || message.startsWith(";;")) {
    Above
    Code:
    Commands.processCommand(player, message.replace("::", "").replace(";;", ""), false, false);
    Put something like;

    Code:
    if(player.isInArea(blablabla) && player.getRights() < 2) { //Administrators can still use commands, remove if u want
    player.getPackets().sendGameMessage("You cannot use commands here");
    return;
    )
    Still don't know the method for the area, haven't touched any rsps in forever.
    Reply With Quote  
     


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: 5
    Last Post: 05-12-2014, 02:56 PM
  2. Replies: 9
    Last Post: 11-26-2013, 06:57 AM
  3. Replies: 5
    Last Post: 11-27-2012, 01:04 PM
  4. Making a spade dig/tele in a certain location
    By cr3zzy in forum Configuration
    Replies: 21
    Last Post: 08-03-2010, 06:34 AM
  5. Disabling/Enabling a certain command.
    By Michaela in forum Help
    Replies: 1
    Last Post: 08-01-2010, 01:35 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
  •