Thread: How to fix this ? [2 QUESTIONS]

Results 1 to 7 of 7
  1. #1 How to fix this ? [2 QUESTIONS] 
    Registered Member Xynasty's Avatar
    Join Date
    Aug 2010
    Age
    29
    Posts
    314
    Thanks given
    52
    Thanks received
    14
    Rep Power
    17
    1. How can I fix safepotting ?

    2. How can I make it so my players needs at least 3 items to PK ?

    Thanks.
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    May 2008
    Age
    30
    Posts
    538
    Thanks given
    117
    Thanks received
    42
    Rep Power
    12
    What base?
    Reply With Quote  
     

  3. #3  
    Registered Member Propel_'s Avatar
    Join Date
    Aug 2010
    Posts
    133
    Thanks given
    0
    Thanks received
    5
    Rep Power
    0
    make safespotting the same as wild, just not wild? idk how to make it more simple lol

    second, add it in boolean attack()
    Fenway` | Propel_
    Reply With Quote  
     

  4. #4  
    Registered Member
    Core's Avatar
    Join Date
    Sep 2007
    Posts
    4,194
    Thanks given
    11
    Thanks received
    393
    Rep Power
    1985
    Code:
    public boolean has3Items() {
    	int itemAmount = 0;
    	for(int i = 0; i < playerEquipment.length; i++) {
    		if(playerEquipment[i] > 0)
    			itemAmount++;
    	}
    	for(int j = 0; j < playerItems.length; j++) {
    		if(playerItems[j] > 0)
    			itemAmount++;
    	}
    	if(itemAmount >= 3)
    		return true;
    	
    	return false;
    }
    There is for 3 items.
    Reply With Quote  
     

  5. #5  
    Registered Member Propel_'s Avatar
    Join Date
    Aug 2010
    Posts
    133
    Thanks given
    0
    Thanks received
    5
    Rep Power
    0
    then put at the top of the attack() method

    if(has3items == true){
    Fenway` | Propel_
    Reply With Quote  
     

  6. #6  
    Registered Member
    Core's Avatar
    Join Date
    Sep 2007
    Posts
    4,194
    Thanks given
    11
    Thanks received
    393
    Rep Power
    1985
    Quote Originally Posted by Propel_ View Post
    then put at the top of the attack() method

    if(has3items == true){
    if(has3Items())
    Reply With Quote  
     

  7. #7  
    Banned

    Join Date
    Jan 2009
    Age
    31
    Posts
    2,661
    Thanks given
    66
    Thanks received
    207
    Rep Power
    0
    Quote Originally Posted by Propel_ View Post
    then put at the top of the attack() method

    if(has3items == true){

    == is for like numbers.

    .equals is for strings.

    boolean use nothing because they are already a boolean.
    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

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •