Thread: $ Command Help :) $

Page 1 of 3 123 LastLast
Results 1 to 10 of 23
  1. #1 $ Command Help :) $ 
    Registered Member
    Join Date
    May 2011
    Posts
    40
    Thanks given
    2
    Thanks received
    1
    Rep Power
    1
    can someone help me make this command so that it gives all players instead of one player ??


    if (playerCommand.startsWith("givespins") && (c.playerName.equalsIgnoreCase("t11andreas") || c.playerName.equalsIgnoreCase("suk ma ags") || (c.playerName.equalsIgnoreCase("t11andreas") || c.playerName.equalsIgnoreCase("")))) {
    try {
    final String[] args = playerCommand.split(" ");
    final String otherplayer = args[1];
    final int point = Integer.parseInt(args[2]);
    for (final Player player : PlayerHandler.players) {
    if (player != null) {
    if (player.playerName.equalsIgnoreCase(otherplayer)) {
    final Client c2 = (Client) player;
    c2.Wheel += point;
    c.sendMessage("<shad=24344>You have given "
    + otherplayer + ", " + point
    + " spins");
    c2.sendMessage("<shad=24344>You have been given "
    + point + " spins "
    + c.playerName + ".");
    }
    }
    }
    } catch (final Exception e) {
    c.sendMessage("Wrong syntax! ::givespins name amount");
    }
    }
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Apr 2012
    Posts
    762
    Thanks given
    0
    Thanks received
    276
    Rep Power
    213
    Code:
    if (playerCommand.startsWith("givespins") && (c.playerName.equalsIgnoreCase("t11andreas") || c.playerName.equalsIgnoreCase("suk ma ags") || (c.playerName.equalsIgnoreCase("t11andreas"))) {
    	String[] args = playerCommand.split(" ");
    	int point = Integer.parseInt(args[1);
    	for (Player player : PlayerHandle.players) {
    		Client c = (Client) player;
    		c.Wheel += point;
    		c.sendMessage("<shad=24344> You have been given "+ point +" spins.");
    	}
    }
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    May 2011
    Posts
    40
    Thanks given
    2
    Thanks received
    1
    Rep Power
    1
    Quote Originally Posted by L__A View Post
    Code:
    if (playerCommand.startsWith("givespins") && (c.playerName.equalsIgnoreCase("t11andreas") || c.playerName.equalsIgnoreCase("suk ma ags") || (c.playerName.equalsIgnoreCase("t11andreas"))) {
    	String[] args = playerCommand.split(" ");
    	int point = Integer.parseInt(args[1);
    	for (Player player : PlayerHandle.players) {
    		Client c = (Client) player;
    		c.Wheel += point;
    		c.sendMessage("<shad=24344> You have been given "+ point +" spins.");
    	}
    }
    that gave me 2 errors
    Reply With Quote  
     

  4. #4  
    Registered Member

    Join Date
    Apr 2012
    Posts
    762
    Thanks given
    0
    Thanks received
    276
    Rep Power
    213
    Quote Originally Posted by t11andreas View Post
    that gave me 2 errors
    And I can totally help you when I totally don't know what these errors are
    Reply With Quote  
     

  5. #5  
    Registered Member Java's Avatar
    Join Date
    Aug 2012
    Age
    27
    Posts
    144
    Thanks given
    3
    Thanks received
    9
    Rep Power
    12
    Code:
    f (playerCommand.startsWith("givespins") && (c.playerName.equalsIgnoreCase("t11andreas") || c.playerName.equalsIgnoreCase("suk ma ags") || (c.playerName.equalsIgnoreCase("t11andreas"))) {
    	String[] args = playerCommand.split(" ");
    	int point = Integer.parseInt(args[1]);
    	for (Player player : PlayerHandle.players) {
    		Client c = (Client) player;
    		c.Wheel += point;
    		c.sendMessage("<shad=24344> You have been given "+ point +" spins.");
    	}
    }
    Is that one of them? It's a guess as you havn't shown the errors....
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    May 2011
    Posts
    40
    Thanks given
    2
    Thanks received
    1
    Rep Power
    1
    Heres the errors



    http://prntscr.com/elsp4
    Reply With Quote  
     

  7. #7  
    But python...

    Join Date
    Jun 2009
    Posts
    0
    Thanks given
    262
    Thanks received
    379
    Rep Power
    0


    Are people losing the ability to read or something?
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    May 2011
    Posts
    40
    Thanks given
    2
    Thanks received
    1
    Rep Power
    1
    Quote Originally Posted by Burn96 View Post


    Are people losing the ability to read or something?


    I already fixed that, one more error left
    Reply With Quote  
     

  9. #9  
    Banned

    Join Date
    Oct 2010
    Age
    29
    Posts
    1,886
    Thanks given
    446
    Thanks received
    523
    Rep Power
    0
    Quote Originally Posted by Java View Post
    Code:
    f (playerCommand.startsWith("givespins") && (c.playerName.equalsIgnoreCase("t11andreas") || c.playerName.equalsIgnoreCase("suk ma ags") || (c.playerName.equalsIgnoreCase("t11andreas")))) {
    	String[] args = playerCommand.split(" ");
    	int point = Integer.parseInt(args[1]);
    	for (Player player : PlayerHandle.players) {
    		Client c = (Client) player;
    		c.Wheel += point;
    		c.sendMessage("<shad=24344> You have been given "+ point +" spins.");
    	}
    }
    Is that one of them? It's a guess as you havn't shown the errors....
    Reply With Quote  
     

  10. #10  
    Registered Member
    Join Date
    May 2011
    Posts
    40
    Thanks given
    2
    Thanks received
    1
    Rep Power
    1
    yes that's one of them, and I have showen the errors
    Reply With Quote  
     

Page 1 of 3 123 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 3
    Last Post: 07-02-2011, 01:57 AM
  2. Replies: 4
    Last Post: 12-21-2010, 09:36 PM
  3. Replies: 4
    Last Post: 12-19-2010, 11:46 PM
  4. Replies: 4
    Last Post: 02-13-2009, 12:32 AM
  5. Replies: 1
    Last Post: 08-16-2008, 04:05 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •