Thread: Return Type Required?

Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1 Return Type Required? 
    Hyperventilate
    Guest
    Code:
    .\Castlewars.java:2: ';' expected
            public static int server.cwarszammymax();
                                    ^
    .\Castlewars.java:2: invalid method declaration; return type required
            public static int server.cwarszammymax();
                                     ^
    .\Castlewars.java:3: ';' expected
            public static int server.cwarssaramax();
                                    ^
    .\Castlewars.java:3: invalid method declaration; return type required
            public static int server.cwarssaramax();
                                     ^
    .\Castlewars.java:4: ';' expected
            public static int server.cwarsguthixmax();
                                    ^
    .\Castlewars.java:4: invalid method declaration; return type required
            public static int server.cwarsguthixmax();
                                     ^
    .\Castlewars.java:5: ';' expected
            public static int server.zammyscore();
                                    ^
    .\Castlewars.java:5: invalid method declaration; return type required
            public static int server.zammyscore();
                                     ^
    .\Castlewars.java:6: ';' expected
            public static int server.sarascore();
                                    ^
    .\Castlewars.java:6: invalid method declaration; return type required
            public static int server.sarascore();
                                     ^
    .\Castlewars.java:7: ';' expected
            public static int server.guthixscore();
                                    ^
    .\Castlewars.java:7: invalid method declaration; return type required
            public static int server.guthixscore();
                                     ^
    12 errors
    Press any key to continue . . .
    How exactly would I fix that?
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Aug 2007
    Posts
    2,395
    Thanks given
    2
    Thanks received
    63
    Rep Power
    558
    give me the whole class
    and
    server.zammyscore();
    doesn't make sense lol
    this does:
    public static int score = server.zammyscore();
    Reply With Quote  
     

  3. #3  
    Hyperventilate
    Guest
    Code:
    public class Castlewars {
    	public static int server.cwarszammymax();
    	public static int server.cwarssaramax();
    	public static int server.cwarsguthixmax();
    	public static int server.zammyscore();
    	public static int server.sarascore();
    	public static int server.guthixscore();
    public static int waitTime = -1;
    public static int gameTime = -1;
    public int Time = 1200; //120 = 1 minute
    public int Time2 = 1320; // 11 minutes
    return;
    public void process() {
     if(gameTime >= 0) {
     gameTime -= 1;
     }
     if(waitTime >= 0) {
     waitTime -= 1;
     }
    if(waitTime == -1)
    {
    sarascore = 0; //resets scores
    zammyscore = 0;
    guthixscore = 0;
    cwarssaramax = 0;//resets max players to 0.
    cwarszammymax = 0; 
    cwarsguthixmax = 0; 
    gameTime = Time; //starts the game (10 minutes)
    waitTime = Time2;
    Yell("[NOTICE]A xxxx game has started.");
    }
    if(gameTime == 0)
    {
    
    Yell("[NOTICE]A xxxx game has ended.");
    }
    }
    }
    Reply With Quote  
     

  4. #4  
    Registered Member

    Join Date
    Aug 2007
    Posts
    2,395
    Thanks given
    2
    Thanks received
    63
    Rep Power
    558
    public static int server.cwarszammymax();
    public static int server.cwarssaramax();
    public static int server.cwarsguthixmax();
    public static int server.zammyscore();
    public static int server.sarascore();
    public static int server.guthixscore();
    ???
    use this:

    public static int scoreOfGod = server.godScore();
    Reply With Quote  
     

  5. #5  
    Hyperventilate
    Guest
    But that's not how they're listed in server.java o.o
    Reply With Quote  
     

  6. #6  
    Registered Member

    Join Date
    Aug 2007
    Posts
    2,395
    Thanks given
    2
    Thanks received
    63
    Rep Power
    558
    Quote Originally Posted by Hyperventilate View Post
    But that's not how they're listed in server.java o.o
    I don't understand what u mean, post code
    Reply With Quote  
     

  7. #7  
    Hyperventilate
    Guest
    Actually, I just used the one in the tutorial. But I got this:
    Code:
    .\Client.java:4827: cannot find symbol
    symbol  : variable server
    location: class Client
    else if (server.cwarssaramax > server.cwarszammymax)
             ^
    .\Client.java:4827: cannot find symbol
    symbol  : variable server
    location: class Client
    else if (server.cwarssaramax > server.cwarszammymax)
                                   ^
    .\Client.java:4839: cannot find symbol
    symbol  : variable Sara
    location: class Client
    Sara = true;
    ^
    .\Client.java:4840: cannot find symbol
    symbol  : variable server
    location: class Client
    server.cwarssaramax += 1;
    ^
    .\Castlewars.java:2: cannot find symbol
    symbol  : variable server
    location: class Castlewars
    int sarascore = server.sarascore;
                    ^
    .\Castlewars.java:3: cannot find symbol
    symbol  : variable server
    location: class Castlewars
    int zammyscore = server.zammyscore;
                     ^
    .\Castlewars.java:4: cannot find symbol
    symbol  : variable server
    location: class Castlewars
    int guthixscore = server.guthixscore;
                      ^
    .\Castlewars.java:5: cannot find symbol
    symbol  : variable server
    location: class Castlewars
    int cwarssaramax = server.cwarssaramax;
                       ^
    .\Castlewars.java:6: cannot find symbol
    symbol  : variable server
    location: class Castlewars
    int cwarszammymax = server.cwarszammymax;
                        ^
    .\Castlewars.java:7: cannot find symbol
    symbol  : variable server
    location: class Castlewars
    int cwarsguthixmax = server.cwarsguthixmax;
                         ^
    Because I used this:
    Code:
    int sarascore = server.sarascore;
    int zammyscore = server.zammyscore;
    int guthixscore = server.guthixscore;
    int cwarssaramax = server.cwarssaramax;
    int cwarszammymax = server.cwarszammymax;
    int cwarsguthixmax = server.cwarsguthixmax;
    Reply With Quote  
     

  8. #8  
    Banned

    Join Date
    Feb 2008
    Age
    29
    Posts
    998
    Thanks given
    1
    Thanks received
    11
    Rep Power
    0
    Hyperventilate server.godScore() are the var values. what you're looking for is.
    Code:
    public static int cwarssaramax = server.cwarssaramax();
    That's NOT properly named either.
    Reply With Quote  
     

  9. #9  
    Hyperventilate
    Guest
    It still cannot find the variable 'server'
    Reply With Quote  
     

  10. #10  
    Human

    Only's Avatar
    Join Date
    Aug 2008
    Posts
    1,108
    Thanks given
    1
    Thanks received
    18
    Rep Power
    116
    Import the server.java? ...
    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
  •