Thread: How to make a command for 2 people?

Page 1 of 2 12 LastLast
Results 1 to 10 of 18
  1. #1 How to make a command for 2 people? 
    Extreme Donator

    Join Date
    Jul 2014
    Posts
    414
    Thanks given
    46
    Thanks received
    8
    Rep Power
    15
    I'm wondering for commands that are designated to a username, how do you make it for 2 usernames?
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Sep 2011
    Posts
    327
    Thanks given
    130
    Thanks received
    17
    Rep Power
    6
    if(playerCommand.startsWith("[REC]") && c.playerName == NAME || c.playerName == NAME2) {


    this is for 317... convert to whatever revision you want
    Reply With Quote  
     

  3. #3  
    Registered Member

    Join Date
    Feb 2013
    Posts
    4,409
    Thanks given
    59
    Thanks received
    478
    Rep Power
    138
    Code:
    if(playerCommand.startsWith("[REC]") && (c.playerName == NAME || c.playerName == NAME2)) {
    Reply With Quote  
     

  4. #4  
    Extreme Donator

    Join Date
    Jul 2014
    Posts
    414
    Thanks given
    46
    Thanks received
    8
    Rep Power
    15
    Ah, I got it anyways, just forgot to mention in the post.

    This works:

    player.getUsername().equalsIgnoreCase("homework") || player.getUsername().equalsIgnoreCase("despair")) {

    That works, right?
    Reply With Quote  
     

  5. #5  
    ZzzzZzzzzZzzzzZzzz
    Shoutout's Avatar
    Join Date
    Sep 2014
    Posts
    259
    Thanks given
    19
    Thanks received
    7
    Rep Power
    11
    Quote Originally Posted by Projecteco View Post
    Ah, I got it anyways, just forgot to mention in the post.

    This works:

    player.getUsername().equalsIgnoreCase("homework") || player.getUsername().equalsIgnoreCase("despair")) {

    That works, right?
    Why don't you try it?
    Reply With Quote  
     

  6. #6  
    What?

    Luminous's Avatar
    Join Date
    Apr 2015
    Posts
    489
    Thanks given
    231
    Thanks received
    341
    Rep Power
    179
    The || is the 'or' operator in java. Should be simple now for future reference
    Reply With Quote  
     

  7. #7  
    Extreme Donator

    Join Date
    Jul 2014
    Posts
    414
    Thanks given
    46
    Thanks received
    8
    Rep Power
    15
    Quote Originally Posted by brie View Post
    Why don't you try it?
    now it says 'You have completed kiln for them' for every command I use.

    Please help!!!
    Reply With Quote  
     

  8. #8  
    Registered Member Vohrex's Avatar
    Join Date
    Jun 2014
    Posts
    44
    Thanks given
    1
    Thanks received
    5
    Rep Power
    15
    Search for You have completed whatever.. and post the method here
    Reply With Quote  
     

  9. #9  
    Extreme Donator

    Join Date
    Jul 2014
    Posts
    414
    Thanks given
    46
    Thanks received
    8
    Rep Power
    15
    Quote Originally Posted by Vohrex View Post
    Search for You have completed whatever.. and post the method here
    It's not the method.
    I removed the all the
    Code:
    || player.getUsername().equalsIgnoreCase("despair")
    and it worked.
    It's a problem with the double username command.
    Reply With Quote  
     

  10. #10  
    Extreme Donator


    Join Date
    Mar 2009
    Posts
    1,461
    Thanks given
    111
    Thanks received
    184
    Rep Power
    79
    Quote Originally Posted by Projecteco View Post
    It's not the method.
    I removed the all the
    Code:
    || player.getUsername().equalsIgnoreCase("despair")
    and it worked.
    It's a problem with the double username command.
    Why have you yet even attempted to troubleshoot or learn something yourself? Really, I'm not trying to sound mean or anything and I realize we all start somewhere but spend a week or two just learning the basics such as this, it'll save you a lot of time and effort in the long run and you won't have to constantly run to the help section.

    OT: Here's a base using switch statements:

    Code:
    case "command":
    if (player.getUsername().equalsIgnoreCase("player1") || player.getUsername().equalsIgnoreCase("player2") {
    doSomething();
    return true;
    }
    return true;
    Attached image
    Quote Originally Posted by MaxXi View Post
    Your combat is so awsome that i almost forgot its the combat matrix coded.
    Quote Originally Posted by twobrosplay View Post
    Try allowing the batch file through your firewall?
    Quote Originally Posted by SS_Alophonse View Post
    i have no life u say ha anything u say kid.i doubt u can even get a girlfriend
    i bet u cant even code anything.
    Reply With Quote  
     

Page 1 of 2 12 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. How to make a command for the rights of 2?
    By Projecteco in forum Help
    Replies: 1
    Last Post: 05-24-2015, 02:08 AM
  2. Replies: 3
    Last Post: 04-11-2014, 12:01 AM
  3. how to make a timer for a command z525
    By lt gangster in forum Help
    Replies: 1
    Last Post: 08-11-2010, 10:43 AM
  4. [Tut] How To Make Basic Commands[Tut]
    By Discardedx2 in forum Tutorials
    Replies: 14
    Last Post: 02-07-2009, 05:37 AM
  5. How To Make Max Player (For New People)
    By Vice in forum Tutorials
    Replies: 10
    Last Post: 03-19-2008, 07:31 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
  •