Thread: Starter Issue

Results 1 to 4 of 4
  1. #1 Starter Issue 
    Registered Member
    CTucker's Avatar
    Join Date
    Oct 2008
    Posts
    2,423
    Thanks given
    263
    Thanks received
    281
    Rep Power
    343
    Ok... Im EPIC CONFUSED

    How the hell Could i fail at this OF ALL THINGS

    Base: Emulous 1.7

    anyway


    here is for saving


    Code:
    			characterfile.write("character-starter = ", 0, 19);
    			characterfile.write(Integer.toString(p.starter), 0, Integer.toString(p.starter).length());
    			characterfile.newLine();

    Loading


    Code:
    else if (token.equals("character-starter")) {
    							p.starter = Integer.parseInt(token2);
    						}

    and calling.


    Code:
    		if(starter != 1) {
    			sendMessage("Hello, "+ playerName + " You must be new");	
    			sendMessage("We have added a few items to your inventory to help you start off.");
    			sendMessage("Please have a good time on " +Config.SERVER_NAME);
    				starter+=500;
    		} else if(starter > 0) {
    			sendMessage("Welcome Back to "+Config.SERVER_NAME+", "+playerName+ "!");
    		}

    it never reads starter as being more then 0? it always pops up saying


    Code:
    			sendMessage("Hello, "+ playerName + " You must be new");	
    			sendMessage("We have added a few items to your inventory to help you start off.");
    			sendMessage("Please have a good time on " +Config.SERVER_NAME);
    Reply With Quote  
     

  2. #2  
    Registered Member
    Linux's Avatar
    Join Date
    Feb 2008
    Age
    24
    Posts
    599
    Thanks given
    104
    Thanks received
    103
    Rep Power
    1457
    Code:
    		if(starter == 0) {
    			sendMessage("Hello, "+ playerName + " You must be new");	
    			sendMessage("We have added a few items to your inventory to help you start off.");
    			sendMessage("Please have a good time on " +Config.SERVER_NAME);
    				starter+=500;
    		} else if(starter == 1) {
    			sendMessage("Welcome Back to "+Config.SERVER_NAME+", "+playerName+ "!");
    		}
    There no once they login once have the value of starter change to a 1 and save it in you player's file.
    Reply With Quote  
     

  3. #3  
    Registered Member
    CTucker's Avatar
    Join Date
    Oct 2008
    Posts
    2,423
    Thanks given
    263
    Thanks received
    281
    Rep Power
    343
    Quote Originally Posted by Linux View Post
    Code:
    		if(starter == 0) {
    			sendMessage("Hello, "+ playerName + " You must be new");	
    			sendMessage("We have added a few items to your inventory to help you start off.");
    			sendMessage("Please have a good time on " +Config.SERVER_NAME);
    				starter+=500;
    		} else if(starter == 1) {
    			sendMessage("Welcome Back to "+Config.SERVER_NAME+", "+playerName+ "!");
    		}
    There no once they login once have the value of starter change to a 1 and save it in you player's file.
    it does save in players file, and it reads it it just doesnt do anything
    Reply With Quote  
     

  4. #4  
    Registered Member
    CTucker's Avatar
    Join Date
    Oct 2008
    Posts
    2,423
    Thanks given
    263
    Thanks received
    281
    Rep Power
    343
    Nevermind, i didn't do anything wrong


    I wrote the code incorrectly the first time and it was saved in the text file as a string instead of an int, i know it sounds wierd but trust me lol

    Anyway i made a new char and it worked fine

    Thanks for the help and sorry 4 the bother
    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
  •