Thread: Public Client Player

Results 1 to 5 of 5
  1. #1 Public Client Player 
    Registered Member
    Join Date
    Aug 2009
    Posts
    6
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Here's my code...

    Code:
    public client player(String otherPname){
            int otherPIndex = PlayerHandler.getPlayerID(otherPname);
            if(otherPIndex != -1)
                {
            client p = (client) server.playerHandler.players[otherPIndex];
            return p;
            }
        return null;
        }
    And here's my errors...

    Code:
    clickingMost.java:51: illegal start of expression
                                    public client player(String otherPname) {
                                    ^
    clickingMost.java:51: ';' expected
                                    public client player(String otherPname) {
                                                        ^
    clickingMost.java:51: ';' expected
                                    public client player(String otherPname) {
                                                                          ^
    3 errors
    Finished!
    Press any key to continue . . .
    Any help would be greatly appreciated.
    Reply With Quote  
     

  2. #2  
    You're My Favourite!

    Join Date
    Aug 2007
    Posts
    1,282
    Thanks given
    485
    Thanks received
    72
    Rep Power
    1397
    Code:
    public client(String otherPname){
         int otherPIndex = PlayerHandler.getPlayerID(otherPname);
            if(otherPIndex != -1) {
               client p = (client) server.playerHandler.players[otherPIndex];
                  return p;
            }
        return null;
    }

    Code:
    public void player(String otherPname){
         int otherPIndex = PlayerHandler.getPlayerID(otherPname);
            if(otherPIndex != -1) {
               client p = (client) server.playerHandler.players[otherPIndex];
                  return p;
            }
    }
    :3




    With Love, Bot.
    Reply With Quote  
     

  3. #3  
    Banned

    Join Date
    Feb 2008
    Age
    29
    Posts
    998
    Thanks given
    1
    Thanks received
    11
    Rep Power
    0
    Bot you're wrong.
    Your issue is simply that you have the code in the wrong place, I'm going to assume you accidentally placed it in another methods body.
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Aug 2009
    Posts
    6
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Quote Originally Posted by 42 View Post
    Bot you're wrong.
    Your issue is simply that you have the code in the wrong place, I'm going to assume you accidentally placed it in another methods body.
    Well, I added it where you said, but now I get two more errors...

    Code:
    client.java:10351: cannot find symbol
    symbol  : method player(java.lang.String)
    location: class client
    if(player(clan) == null) {
       ^
    client.java:10356: cannot find symbol
    symbol  : method player(java.lang.String)
    location: class client
    client c2 = player(clan); //clanLeader
                ^
    2 errors
    Finished!
    Press any key to continue . . .
    Reply With Quote  
     

  5. #5  
    Banned

    Join Date
    Jan 2009
    Age
    31
    Posts
    2,661
    Thanks given
    66
    Thanks received
    207
    Rep Power
    0
    This will fix all your problems....

    Code:
    	public client getClientIndex(String name)
    	{
    		for(Player p : server.playerHandler.players){
    			if(p != null) {
    				if(p.playerName.equals(name))
    					return (client) p;
    			}
    		}
    	return null;
    	}
    Code:
    	public Player getPlayerIndex(String name)
    	{
    		for(Player p : server.playerHandler.players){
    			if(p != null) {
    				if(p.playerName.equals(name))
    					return p;
    			}
    		}
    	return null;
    	}
    Code:
    	public client getClientIndex(int index)
    	{
    		for(Player p : server.playerHandler.players){
    			if(p != null) {
    				if(p.playerId == index)
    				return (client) p;
    			}
    		}
    	return null;
    	}
    Code:
    	public Player getPlayerIndex(int index)
    	{
    		for(Player p : server.playerHandler.players){
    			if(p != null) {
    				if(p.playerId == index)
    				return p;
    			}
    		}
    	return null;
    	}
    Code:
    	public client c(Player p)
    	{
    		return (client) p;
    	}

    wtf????? fail.
    Quote Originally Posted by Bot View Post
    Code:
    public client(String otherPname){

    Code:
    public void player(String otherPname){
    :3
    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
  •