Thread: if(cmd = gearname1) {do this}, not working

Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1 if(cmd = gearname1) {do this}, not working 
    Registered Member
    Join Date
    Dec 2014
    Posts
    348
    Thanks given
    20
    Thanks received
    5
    Rep Power
    8
    basically im trying to make it so if u savesomething by a certain name, u can load it with that name in the command, for example;

    Code:
    case "gear":
    if (cmd[1].equals(player.getSavedGear1Name())){
    loadmygear1
    }
    return true;
    that doesn't work, any clue what im doing wrong? heres my method in player.java

    Code:
    public String getSavedGear1Name() {
    		return savedgear1name;
    	}
    	public void setSavedGear1Name(String savedgear1name) {
    		this.savedgear1name = savedgear1name;
    	}
    (does not show any errors/warning when compiling/running, just disfunctional)
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Feb 2013
    Posts
    4,409
    Thanks given
    59
    Thanks received
    478
    Rep Power
    138
    Should try printing each value.
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Dec 2014
    Posts
    348
    Thanks given
    20
    Thanks received
    5
    Rep Power
    8
    Quote Originally Posted by Mayne View Post
    Should try printing each value.
    what do u mean
    Reply With Quote  
     

  4. #4  
    Registered Member

    Join Date
    Feb 2013
    Posts
    4,409
    Thanks given
    59
    Thanks received
    478
    Rep Power
    138
    Quote Originally Posted by _Blank View Post
    what do u mean
    What do you mean that it doesn't work?
    What's your loadmygear1 function?
    When you print out the cmd[1] and the getSavedGear1Name, do they match?
    Reply With Quote  
     

  5. #5  
    Registered Member
    Totty's Avatar
    Join Date
    Jan 2015
    Age
    26
    Posts
    221
    Thanks given
    53
    Thanks received
    385
    Rep Power
    602
    By the way, this is what they mean : Console.WriteLn(getSavedGear1Name());
    Reply With Quote  
     

  6. #6  
    Donator


    Join Date
    Jan 2014
    Posts
    1,652
    Thanks given
    428
    Thanks received
    501
    Rep Power
    221
    Just create an array with gearsets?
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Dec 2014
    Posts
    348
    Thanks given
    20
    Thanks received
    5
    Rep Power
    8
    Quote Originally Posted by Joris View Post
    Just create an array with gearsets?
    Quote Originally Posted by Totty View Post
    By the way, this is what they mean : Console.WriteLn(getSavedGear1Name());
    Quote Originally Posted by Mayne View Post
    What do you mean that it doesn't work?
    What's your loadmygear1 function?
    When you print out the cmd[1] and the getSavedGear1Name, do they match?
    savedgear1name = any random combination, the command to is it is like how u could change a yell color etc,

    so if i save the gear savedgear1name as "dhvengpk123"

    how would i load it using an input command, something like the one i posted @ top
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Jan 2015
    Posts
    58
    Thanks given
    1
    Thanks received
    2
    Rep Power
    11
    Quote Originally Posted by _Blank View Post
    what do u mean
    if ur asking what he means by printing u obvs didnt write that cmd
    Reply With Quote  
     

  9. Thankful user:


  10. #9  
    Owner of Dawntained

    Mgt Madness's Avatar
    Join Date
    Oct 2011
    Age
    28
    Posts
    3,380
    Thanks given
    1,429
    Thanks received
    958
    Rep Power
    2168
    System.out.println(enter primitive data/string/array/everything);
    this is how you debug
    Attached image
    Reply With Quote  
     

  11. #10  
    Registered Member
    Join Date
    Dec 2014
    Posts
    348
    Thanks given
    20
    Thanks received
    5
    Rep Power
    8
    Quote Originally Posted by qualitygamerz View Post
    if ur asking what he means by printing u obvs didnt write that cmd
    l0l.
    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. Replies: 1
    Last Post: 01-06-2012, 05:08 PM
  2. [PI] paying if you can do this simple thing
    By I Am Kacey in forum Requests
    Replies: 3
    Last Post: 06-05-2011, 01:12 PM
  3. Why does this not work?
    By Wake in forum Help
    Replies: 0
    Last Post: 01-06-2011, 10:16 AM
  4. Will give $10 if you can do this
    By lostscape in forum Help
    Replies: 0
    Last Post: 12-28-2009, 06:04 PM
  5. If you can do this ,youll have the whole mappack
    By Missedscape in forum Configuration
    Replies: 10
    Last Post: 07-13-2008, 03:42 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
  •