Thread: ::starter help.

Results 1 to 10 of 10
  1. #1 ::starter help. 
    Hockeydude
    Guest
    Ok, I set my starter to 10m, but I want it so it can only be used once per account, can someone please explain how to do this.

    In my command.Java this is what I have for starter:

    }
    if (cmd[0].equals("starter")) {
    Engine.playerItems.addItem(p, 995, 10000000);
    p.starter = 1;

    But for some reason, I can keep on typing it and keep on getting 10m over and over again when I only want it to work once.

    Can someone please tell me how to fix this, and if needed, what to change it to.
    Reply With Quote  
     

  2. #2  
    I sfogliare Rune-server ad alta


    Join Date
    Nov 2008
    Age
    30
    Posts
    1,702
    Thanks given
    41
    Thanks received
    18
    Rep Power
    791
    declare
    public int starter = 0;
    in player.java..
    Reply With Quote  
     

  3. #3  
    Community Veteran


    Join Date
    Dec 2008
    Posts
    4,263
    Thanks given
    405
    Thanks received
    436
    Rep Power
    1674
    change it to

    Code:
    if (cmd[0].equals("starter") && p.starter == 0)) {
        Engine.playerItems.addItem(p, 995, 10000000);
        p.starter = 1;
    }
    Reply With Quote  
     

  4. #4  
    I sfogliare Rune-server ad alta


    Join Date
    Nov 2008
    Age
    30
    Posts
    1,702
    Thanks given
    41
    Thanks received
    18
    Rep Power
    791
    Quote Originally Posted by Jonathan View Post
    change it to

    Code:
    if (cmd[0].equals("starter") && p.starter == 0)) {
        Engine.playerItems.addItem(p, 995, 10000000);
        p.starter = 1;
    }
    Ahh yes forgot that
    Code:
    p.starter == 0
    lol...
    Reply With Quote  
     

  5. #5  
    Hockeydude
    Guest
    The weird part is, if I change it to what you guys told me, it won't let me use :tarter at all, like I will type it in, and not get a starter.

    Also with this command:

    if (cmd[0].equals("starter") && p.starter == 0)) {
    Engine.playerItems.addItem(p, 995, 10000000);
    p.starter = 1;
    }

    after I do that, save and then compile, it shows up with one error, pointing to the second bracket-->) after p.starter == 0)) <---The one right there.

    My brother tried helping me by changing it around a little bit, and it now works, but once you relog, you can type :tarter and get another 10m.

    Here is what it looks like right now:

    }
    if (cmd[0].equals("starter") && p.starter == 0) {
    Engine.playerItems.addItem(p, 995, 10000000);
    p.starter = 1;
    }
    if (cmd[0].equals("starter")) {


    I know it looks weird, but the problem with this one is you only get one starter, but if you relog you get 1 more, and you can keep on relogging and getting 1 starter per relog.
    Reply With Quote  
     

  6. #6  
    Banned

    Join Date
    Jul 2008
    Age
    28
    Posts
    5,827
    Thanks given
    1,301
    Thanks received
    197
    Rep Power
    0
    then in player,
    int starter = 0;
    Reply With Quote  
     

  7. #7  
    Hockeydude
    Guest
    I have, does it matter where I add the coeds, or do I have to do it in a certain spot?
    Reply With Quote  
     

  8. #8  
    Hockeydude
    Guest
    BUMP!!!

    Ok, so i'll explain the problem a little bit better,

    So I have added a :tarter into the game, it's 10m cash.
    If I log in and type :tarter, I will get the 10m cash, and if I try to type :tarter again, I will not get a second starter.
    When I log out, and log back in, and try and type starter, on the same account, I will get another 10m cash, and you can keep on relogging and typing :tarter once per login, and keep on getting 10m cash.

    I've tried adding Public int starter = 0; but that doesn't seem to help.

    This is Codeusa btw, and it's z508, so it doesn't have login.java and stuff for some reason

    Please help, i've been trying to find this for 4 days now.
    Reply With Quote  
     

  9. #9  
    Registered Member
    ƅʅ1ƭȥȥ ツ's Avatar
    Join Date
    May 2008
    Age
    30
    Posts
    1,132
    Thanks given
    10
    Thanks received
    8
    Rep Power
    330
    Z508 has Rs2LoginProtocol almost the same like Login.java

    in commands. use this

    if (cmd[0].equals("starter")) {
    if (p.starter == 0) {
    Engine.playerItems.addItem(p, 995, 1000000);
    Add More items Here
    p.starter = 1;
    } else {
    p.frames.sendMessage(p, "You already have your starter set");
    }
    }
    Player.java Under:
    public int wildernessLevel;
    Add this
    public int starter = 0;
    In Filemanager.java
    stream.writeString("starter:" + p.starter);
    Under
    stream.writeString("gender:" + p.gender);
    and
    else if (line.startsWith("starter:"))
    p.starter = Integer.parseInt(line.substring(8));
    Under
    else if (line.startsWith("gender:"))
    p.gender = Integer.parseInt(line.substring(7));
    Bl1tzz
    Reply With Quote  
     

  10. #10  
    Hockeydude
    Guest
    Thank you soo much, it finally worked!!

    Rep for you

    Thanks again, and thanks to everyone who tried helping!
    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
  •