Thread: how to make this command work right

Results 1 to 5 of 5
  1. #1 how to make this command work right 
    Chow down on these noodles
    OodlesOfNoodles's Avatar
    Join Date
    May 2011
    Posts
    1,819
    Thanks given
    235
    Thanks received
    91
    Rep Power
    55
    how would i get this command to only let player rights 3 and 6 tele here

    if(playerCommand.startsWith("royalzone") && (c.playerRights == 3) && (c.playerRights == 6)) {
    c.getPA().spellTeleport(2368, 4957, 0);
    c.startAnimation(13288);
    c.teleTimer = 8;
    c.gfx0(2516);
    c.teleEndAnimation = 13285;
    }
    cuz how i have it isnt working .-.
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Aug 2011
    Posts
    766
    Thanks given
    105
    Thanks received
    59
    Rep Power
    114
    In Commands.java do this.

    if (c.playerRights >= 0) {
    Then add all your 0 player rights commands here.
    }

    if (c.playerRights >= 1) {
    Then add all your 1 player rights commands here.
    }

    if (c.playerRights >= 2)
    Then add all your 2 player rights commands here.
    {

    if (c.playerRights == 3){
    Then here add all your 3..
    }

    if (c.playerRights == 6) {
    Then add your 6...
    }

    Done.
    Spoiler for vouches:

    Quote Originally Posted by TheMrClassic View Post
    Vouch for Insidia X. Fast and friendly.
    Quote Originally Posted by Vernorexia View Post
    Vouch for insidia x added clipped following and a timer on my gates. I paid first was fast work. I highly recommend using him!
    Quote Originally Posted by Matts B ring View Post
    Bought 5b ikov, vouch
    Quote Originally Posted by InsinuateRS View Post
    Vouch for me lad, bought 3b

    Reply With Quote  
     

  3. #3  
    Registered Member Incipio's Avatar
    Join Date
    Jul 2011
    Posts
    182
    Thanks given
    20
    Thanks received
    34
    Rep Power
    3
    @above, What kind of sucky answer was that o_O You didn't solve his problem at all

    OT:
    The problem is this:
    Code:
    if(playerCommand.startsWith("royalzone") && (c.playerRights == 3) && (c.playerRights == 6)) {
    c.getPA().spellTeleport(2368, 4957, 0);
    c.startAnimation(13288);
    c.teleTimer = 8;
    c.gfx0(2516);
    c.teleEndAnimation = 13285;
    }
    && means AND. You can't be 3 AND 6. What you're looking for is OR. Use || instead of &&.

    Code:
    if(playerCommand.startsWith("royalzone") && (c.playerRights == 3) || (c.playerRights == 6)) {
    c.getPA().spellTeleport(2368, 4957, 0);
    c.startAnimation(13288);
    c.teleTimer = 8;
    c.gfx0(2516);
    c.teleEndAnimation = 13285;
    }
    That should work Feel free to rep/thank


    Feel free to rep/thank if I help!


    ~Huge RSPS Guide (incomplete)~
    Reply With Quote  
     

  4. Thankful user:


  5. #4  
    Chow down on these noodles
    OodlesOfNoodles's Avatar
    Join Date
    May 2011
    Posts
    1,819
    Thanks given
    235
    Thanks received
    91
    Rep Power
    55
    mines pi 317. it has a handy little thing like this.
    if (Config.SERVER_DEBUG)
    Misc.println(c.playerName+" playerCommand: "+playerCommand);

    if (c.playerRights >= 0)
    playerCommands(c, playerCommand, cmd, input);
    if (c.playerRights == 1 || c.playerRights == 2 || c.playerRights == 3)
    moderatorCommands(c, playerCommand);
    if (c.playerRights == 2 || c.playerRights == 3)
    administratorCommands(c, playerCommand);
    if (c.playerRights == 3)
    ownerCommands(c, playerCommand);
    if (c.playerRights >= 2 || c.isDonator == 1)
    DonatorCommands(c, playerCommand);

    }
    then under
    public void playerCommands(Client c, String playerCommand, String cmd, String input)
    {
    and so on you add the commands.
    Reply With Quote  
     

  6. #5  
    #Winning

    Join Date
    Apr 2011
    Age
    28
    Posts
    2,245
    Thanks given
    367
    Thanks received
    388
    Rep Power
    1187
    Atm it is saying you need to have a playerRights of 3 AND a player rights of 6. Change it to OR.

    Like this: if(playerCommand.startsWith("royalzone") && (c.playerRights == 3) || (c.playerRights == 6)) {


    Vouches
    Spoiler for Vouches:

    Quote Originally Posted by Exile rsps View Post
    Vouch thanks for that pic
    Quote Originally Posted by bwuk _im_pb View Post
    i vouch for charlie hes legit
    Quote Originally Posted by Pastaway
    Vouch for 'Charlie. Added a tut to my server I couldn't add and payed him after =]
    Quote Originally Posted by mongolias
    Vouch for 'Charlie. Sold me a banner, the trade went quick and efficiently.
    Quote Originally Posted by Lane
    Vouch for charlie, he is #1
    Quote Originally Posted by Raw Envy View Post
    Vouch for Charlie.
    Quote Originally Posted by -Null Code-
    Vouch Legit bought rs membership
    Quote Originally Posted by tucybro
    Traded with Charlie, went smoothly I went first and he paid promptly without and issues, great trader!



    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. How to Make Cook X, Make X and Craft X Work.
    By minutes in forum Tutorials
    Replies: 9
    Last Post: 01-11-2010, 02:24 AM
  2. Replies: 1
    Last Post: 08-21-2009, 03:02 AM
  3. Will this command work??
    By tonic in forum Help
    Replies: 4
    Last Post: 02-22-2009, 10:33 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
  •