Thread: Why wont my command work 317

Results 1 to 9 of 9
  1. #1 Why wont my command work 317 
    Registered Member
    Join Date
    Aug 2014
    Posts
    44
    Thanks given
    1
    Thanks received
    0
    Rep Power
    11
    Code:
    		if (c.playerRights >= 1 && c.playerRights <= 0) {
    			if (playerCommand.equals("jad")) {
    				c.getPA().startTeleport(2480, 5175, 0, "modern");
    					c.sendMessage("Kill Jad and get you'r firecape");

    I dont understand why normal players can't use the command, when player_rights is = 0.
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    May 2015
    Posts
    67
    Thanks given
    1
    Thanks received
    3
    Rep Power
    11
    Quote Originally Posted by Wopean View Post
    Code:
    		if (c.playerRights >= 1 && c.playerRights <= 0) {
    			if (playerCommand.equals("jad")) {
    				c.getPA().startTeleport(2480, 5175, 0, "modern");
    					c.sendMessage("Kill Jad and get you'r firecape");

    I dont understand why normal players can't use the command, when player_rights is = 0.
    Why do you have it for player rights 1 and 0 ? that's the real question.
    Don't Fear Life, As lIfe Is Key To Everything
    Reply With Quote  
     

  3. #3  
    Banned
    Join Date
    May 2015
    Posts
    56
    Thanks given
    4
    Thanks received
    8
    Rep Power
    0
    just change the 1 to 0 l0l..
    Reply With Quote  
     

  4. #4  
    Hollow Realm

    Join Date
    Sep 2013
    Posts
    295
    Thanks given
    12
    Thanks received
    11
    Rep Power
    1
    Quote Originally Posted by Dev Life View Post
    Why do you have it for player rights 1 and 0 ? that's the real question.
    Well, everyone starts somewhere.

    OT: You have your command set to if your rights are greater than 1, and less than 0, then you can run this command. Thus why your command won't work.

    This one will work for anyone with the rights of 0 and higher.

    Code:
    		if (c.playerRights >= 0) {
    			if (playerCommand.equals("jad")) {
    				c.getPA().startTeleport(2480, 5175, 0, "modern");
    					c.sendMessage("Kill Jad and get your firecape");
                         }
                 }
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Aug 2014
    Posts
    44
    Thanks given
    1
    Thanks received
    0
    Rep Power
    11
    Code:
    if (c.playerRights >= 0) {
    			if (playerCommand.equals("jad")) {
    				c.getPA().startTeleport(2480, 5175, 0, "modern");
    					c.sendMessage("Kill Jad and get your firecape");


    Now i can use it, but im owner. Normal Players, they can't use it.
    Reply With Quote  
     

  6. #6  
    Hollow Realm

    Join Date
    Sep 2013
    Posts
    295
    Thanks given
    12
    Thanks received
    11
    Rep Power
    1
    Try this one.

    Code:
    if (playerCommand.equals("jad") && (c.playerRights >= 0)) {
    				c.getPA().startTeleport(2480, 5175, 0, "modern");
    					c.sendMessage("Kill Jad and get your firecape");
    }
    Reply With Quote  
     

  7. #7  
    Myre


    Join Date
    Apr 2012
    Age
    26
    Posts
    1,519
    Thanks given
    407
    Thanks received
    367
    Rep Power
    475
    Code:
    if (c.playerRights >= 1 && c.playerRights <= 0) {
    			if (playerCommand.equals("jad")) {
    				c.getPA().startTeleport(2480, 5175, 0, "modern");
    					c.sendMessage("Kill Jad and get you'r firecape");
    What you're doing here is saying
    Code:
    if (c.playerRights >= 1 && c.playerRights <= 0) {
    If the playerRights are greater than or equal to 1 and their rights are also less than or equal to 0. You would pretty much have to switch it so its

    Code:
    if (c.playerRights >= 0 && c.playerRights <= 1) {
    the playerRights are greater or equal to 0 and are less than or equal to 1. Meaning Mods and Normal Players can use it.
    Reply With Quote  
     

  8. #8  
    Community Veteran


    Arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,950
    Thanks given
    210
    Thanks received
    349
    Rep Power
    1376
    You mght of misplaced it where your owner rights is being checked.


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  9. #9  
    Ex Rune-Scaper

    Join Date
    Jun 2008
    Posts
    3,534
    Thanks given
    457
    Thanks received
    1,257
    Rep Power
    990
    Quote Originally Posted by Wopean View Post
    Code:
    		if (c.playerRights >= 1 && c.playerRights <= 0) {
    			if (playerCommand.equals("jad")) {
    				c.getPA().startTeleport(2480, 5175, 0, "modern");
    					c.sendMessage("Kill Jad and get you'r firecape");

    I dont understand why normal players can't use the command, when player_rights is = 0.
    I don't understand why you don't just do

    Code:
    			if (playerCommand.equals("jad")) {
    				c.getPA().startTeleport(2480, 5175, 0, "modern");
    					c.sendMessage("Kill Jad and get you'r firecape");
    What you said above says if you are player rights of 1 or higher AND you are player rights of 0 and less.. Which makes no sense.

    I would recommend checking this out.

    Java - Basic Operators
    Attached image
    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. 667/712 Why wont this command work?
    By Godliike 667 in forum Help
    Replies: 7
    Last Post: 06-10-2012, 03:15 PM
  2. why wont my yell work
    By i own u 23 in forum Help
    Replies: 6
    Last Post: 06-03-2012, 05:30 AM
  3. [Delta] why wont mute command work
    By himskater in forum Help
    Replies: 9
    Last Post: 08-13-2010, 10:38 PM
  4. Replies: 4
    Last Post: 07-26-2010, 02:25 PM
  5. Replies: 3
    Last Post: 07-26-2010, 02:27 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
  •