Thread: Command Help

Results 1 to 4 of 4
  1. #1 Command Help 
    Registered Member
    Join Date
    Jun 2012
    Posts
    11
    Thanks given
    0
    Thanks received
    1
    Rep Power
    11
    Hello guys i recently just came back to rsps, and there was a code i really like but now forgot it was like you do this:

    I owner go like

    ::money xmagz

    which basically it automatically would give 5m to the player but i forgot how to create this code any know and could help?

    ABOVE QUESTION AND REQUEST WAS SOLVED!!
    Reply With Quote  
     

  2. #2  
    I'm secretly a carrot named 3arl.

    Mainframe's Avatar
    Join Date
    Jun 2012
    Age
    26
    Posts
    1,422
    Thanks given
    542
    Thanks received
    214
    Rep Power
    147
    Commands.java is a good place to start.
    Reply With Quote  
     

  3. #3  
    Donator


    Join Date
    Sep 2011
    Posts
    2,730
    Thanks given
    1,150
    Thanks received
    907
    Rep Power
    668
    Try that.

    Code:
    if (playerCommand.startsWith("money")) {
    			try {
    				String playerGivenMoney = playerCommand.substring(7);
    				for (int i = 0; i < Config.MAX_PLAYERS; i++) {
    					if (PlayerHandler.players[i] != null) {
    						if (PlayerHandler.players[i].playerName
    								.equalsIgnoreCase(playerGivenMoney)) {
    							c.sendMessage("You have given 5m to the user the user: "
    									+ PlayerHandler.players[i].playerName);
    							Client c2 = (Client) PlayerHandler.players[i];
    							c2.sendMessage("You have been given 5m from: "
    									+ c.playerName);
    							c2.getItems().addItem(995, 5000000);
    							break;
    						}
    					}
    				}
    			} catch (Exception e) {
    				c.sendMessage("Player Must Be Offline.");
    			}
    		}
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Jun 2012
    Posts
    11
    Thanks given
    0
    Thanks received
    1
    Rep Power
    11
    Quote Originally Posted by KJ View Post
    Commands.java is a good place to start.
    mm i know that one but i mean whats the code to put in the command.java?
    for that execution?
    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

Similar Threads

  1. Replies: 50
    Last Post: 04-17-2014, 02:19 PM
  2. Replies: 3
    Last Post: 07-02-2011, 01:57 AM
  3. Replies: 4
    Last Post: 12-21-2010, 09:36 PM
  4. Replies: 4
    Last Post: 12-19-2010, 11:46 PM
  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
  •