Thread: [PI] Correct code? (c.something = +1)?

Results 1 to 3 of 3
  1. #1 [PI] Correct code? (c.something = +1)? 
    Registered Member
    Join Date
    Feb 2011
    Posts
    217
    Thanks given
    16
    Thanks received
    41
    Rep Power
    50
    Decompiling errors: no

    Problem: I need some help with the correct code.

    i have a line that saves in character file. Well it looks like:
    Code:
    DungKC = 0
    Player.java code:
    Code:
    	public int DungKC;
    PlayerSave.java code:
    Code:
    	} else if (token.equals("DungKC")) {
    		p.DungKC = Integer.parseInt(token2);
    PlayerSave.java code:
    Code:
    characterfile.write("DungKC = ", 0, 9);
    	characterfile.write(Integer.toString(p.DungKC), 0, Integer.toString(p.DungKC).length());
    	characterfile.newLine();
    Well, I wanted to know, how can i make the "0" in the character file increase by 1, everytime i do a special action.

    I tried this code:
    Code:
    c.DungKC = +1
    Ok first time I do that action, DungKC increases by "1". Then it doesn't increase. It just stands "1" if i'm doing action again and again...

    So, I just wanted to know, why is that?
    I think that code is wrong. I need a code that increases the value by "1" everytime I do that action.
    Reply With Quote  
     

  2. #2  
    Номер 1


    Leanbow's Avatar
    Join Date
    Feb 2008
    Posts
    5,910
    Thanks given
    1,558
    Thanks received
    2,617
    Rep Power
    5000
    c.DungKC += 1
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Feb 2011
    Posts
    217
    Thanks given
    16
    Thanks received
    41
    Rep Power
    50
    Quote Originally Posted by Macho Man View Post
    c.DungKC += 1
    Thanks! worked!
    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. correct this code :O?
    By Syndicate in forum Help
    Replies: 3
    Last Post: 07-16-2010, 06:20 PM
  2. Replies: 25
    Last Post: 05-06-2010, 10:49 AM
  3. Correct hypercam 2 register code..
    By Proffesor Oak in forum Software
    Replies: 4
    Last Post: 07-10-2009, 08:42 PM
  4. [Code]Correct master loop for player stats
    By Wolf in forum Configuration
    Replies: 28
    Last Post: 06-19-2008, 12:22 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
  •