Thread: [PI] Making this Command Work?

Results 1 to 3 of 3
  1. #1 [PI] Making this Command Work? 
    Registered Member
    Join Date
    Nov 2013
    Posts
    85
    Thanks given
    4
    Thanks received
    0
    Rep Power
    8
    Hi guys i need a little help,

    well basically i want to add a command like :etbounty (playername) (amount of credits) so for example: :etbounty test 100, so now 100 credits will be removed from your account and whoever kills the player "test" will receive the 100 credits.

    Anyone? Help appreciated alot, REP+
    Reply With Quote  
     

  2. #2  
    Registered Member LIETUVAITIS's Avatar
    Join Date
    Apr 2013
    Posts
    190
    Thanks given
    45
    Thanks received
    5
    Rep Power
    11
    Try to use Commandgenerator, whis can be found at tools category.
    Reply With Quote  
     

  3. #3  
    Registered Member
    Syles's Avatar
    Join Date
    Oct 2013
    Posts
    404
    Thanks given
    51
    Thanks received
    63
    Rep Power
    180
    Quote Originally Posted by xsaeedx View Post
    Hi guys i need a little help,

    well basically i want to add a command like :etbounty (playername) (amount of credits) so for example: :etbounty test 100, so now 100 credits will be removed from your account and whoever kills the player "test" will receive the 100 credits.

    Anyone? Help appreciated alot, REP+
    THIS IS JUST AN EXAMPLE. THIS CODE WILL NOT WORK FOR YOU

    The following code is to use a a guide to implement into your server. It isn't really coded that well, and will not work how it stands, but I'm sure you can figure out how to make it work for you.

    Code:
    if (playerCommand.startsWith("setbounty")){
    			String[] args = playerCommand.split(" ");
    			String bountyOn = args[1];
    			for (Player p2 : PlayerHandler.players){
    				if (p2 != null) {
    					if(p2.playerName.equalsIgnoreCase(bountyOn)) {
    						try{
    							int bountyCost = Integer.parseInt(args[2]);
    							p2.hasBounty = true;
    							p2.bountyAmnt = bountyCost;
    							p2.getPlayerAssistant().sendMessage("" + bountyOn " has had a bounty set on them.");
    							p2.getPlayerAssistant().sendMessage("You've set a bounty on " + bountyOn + ".");
    						}catch(Exception e){
    							e.printStackTrace();
    						}
    					}
    				}
    			}
    		}
    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. Help me make this command work?
    By Silentriyl in forum Help
    Replies: 3
    Last Post: 01-05-2014, 08:11 AM
  2. Replies: 1
    Last Post: 10-26-2013, 06:22 PM
  3. Replies: 4
    Last Post: 11-14-2011, 04:08 PM
  4. how to make this command work right
    By OodlesOfNoodles in forum Help
    Replies: 4
    Last Post: 11-07-2011, 03:27 AM
  5. Making this command not work in wildy
    By jordan641 in forum Requests
    Replies: 0
    Last Post: 12-27-2010, 10:48 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
  •