Thread: player saving

Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1 player saving 
    Community Veteran

    Patawic's Avatar
    Join Date
    Dec 2006
    Age
    29
    Posts
    1,950
    Thanks given
    40
    Thanks received
    150
    Rep Power
    2463
    Im trying to make saving the "classd" of the player on my server work

    in clickingMost.java i have
    Code:
    case 43027:
    c.sM("You have chosen the Human Class");
    c.RemoveAllWindows();
    selection = 1;
    break;
    in client.java i have
    Code:
    else if (token.equals("character-class")) {
                            selection = Integer.parseInt(token2);
    How do i make the variable from clickingMost.java work in client.java
    As im currently getting errors of the variable not being found.

    Reply With Quote  
     

  2. #2  
    Doctor p - Sweet Shop

    Join Date
    Apr 2007
    Age
    31
    Posts
    6,835
    Thanks given
    150
    Thanks received
    584
    Rep Power
    2595
    you need to declare it in client class and call it in clickingmost class by c.selection

    but i advised to rename selection to something better like classType or classId

    Reply With Quote  
     

  3. #3  
    Austin_
    Guest
    Have you declared the varible in player.java try public int selection; or public int classd;
    Reply With Quote  
     

  4. #4  
    Community Veteran

    Patawic's Avatar
    Join Date
    Dec 2006
    Age
    29
    Posts
    1,950
    Thanks given
    40
    Thanks received
    150
    Rep Power
    2463
    how do i declare stuff . i know that sounds epically nooby, but ive just started learning how to do this stuff

    Reply With Quote  
     

  5. #5  
    Austin_
    Guest
    Okay add it under public abstract class Player implements Constants { in player.java or player class..

    p.s: Read my SB appeal
    Reply With Quote  
     

  6. #6  
    ⚓Manic-Owner⚓


    Join Date
    Nov 2007
    Posts
    2,711
    Thanks given
    47
    Thanks received
    9
    Rep Power
    650
    I assume your getting a static error? Please post the error your getting.
    Reply With Quote  
     

  7. #7  
    Community Veteran

    Patawic's Avatar
    Join Date
    Dec 2006
    Age
    29
    Posts
    1,950
    Thanks given
    40
    Thanks received
    150
    Rep Power
    2463
    Code:
    clickingMost.java:75: cannot find symbol
    symbol  : variable selection
    location: class client
    c.selection = 1;
     ^
    clickingMost.java:87: cannot find symbol
    symbol  : variable selection
    location: class client
    c.selection = 2;
     ^
    clickingMost.java:101: cannot find symbol
    symbol  : variable selection
    location: class client
    c.selection = 3;
     ^
    clickingMost.java:115: cannot find symbol
    symbol  : variable selection
    location: class client
    c.selection = 4;
     ^
    client.java:10666: cannot find symbol
    symbol  : variable selection
    location: class client
                                                    selection = Integer.parseInt(tok
    en2);
                                                    ^
    Note: Some input files use or override a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    5 errors
    Press any key to continue . . .

    Reply With Quote  
     

  8. #8  
    Austin_
    Guest
    in player.java declare pulic int selection;
    Reply With Quote  
     

  9. #9  
    ⚓Manic-Owner⚓


    Join Date
    Nov 2007
    Posts
    2,711
    Thanks given
    47
    Thanks received
    9
    Rep Power
    650
    Follow these steps and ignore everyone else.

    At the top of client.java under player immplements {

    add this:

    Code:
    public static selection = 0;
    Then at the top of clicking most, add

    Code:
    public static client client;
    Post any errors I might of given you.
    Reply With Quote  
     

  10. #10  
    Retired. Stop PMing me.


    Galkon's Avatar
    Join Date
    Nov 2007
    Age
    17
    Posts
    7,526
    Thanks given
    1,805
    Thanks received
    2,830
    Rep Power
    5000
    Jesus fuck.

    Pat, in client.java add:

    public int selection;
    Attached image
    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

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