Thread: [PI] ::kill command [Project Insanity]

Results 1 to 9 of 9
  1. #1 [PI] ::kill command [Project Insanity] 
    Registered Member IcEbLiTzMeHh's Avatar
    Join Date
    Jul 2010
    Posts
    241
    Thanks given
    3
    Thanks received
    16
    Rep Power
    4
    Base: Project Insanity[PI]
    Problem: Could someone be kind enough to give me a "::kill playername" command?
    Errors(Compiling Errors): N/A
    Other Information/Media(Pictures, etc): N/A

    Will rep++
    Thanks,
    Arran

    Quote Originally Posted by onemorenight View Post


    plz i need the cape name who the guy is wearing
    Quote Originally Posted by Liam Baby View Post


    Never go full retard
    Reply With Quote  
     

  2. #2  
    Registered Member
    gomomo11's Avatar
    Join Date
    May 2010
    Posts
    2,379
    Thanks given
    268
    Thanks received
    196
    Rep Power
    177
    As simple as that
    if (playerCommand.startsWith("kill")) {
    String nameToKill = playerCommand.substring(5);
    for (int i = 0; i < Config.MAX_PLAYERS; i++) {
    if (Server.playerHandler.players[i] != null) {
    if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(nameToKill)) {
    c.getPA().applyDead();
    c.sendMessage("You died.");
    }
    }
    }
    }
    No problem, post if you have any error
    Attached image
    no external links without affiliate
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Sep 2010
    Posts
    104
    Thanks given
    0
    Thanks received
    1
    Rep Power
    1
    Lol i tryed that, it just killed myself?
    Reply With Quote  
     

  4. #4  
    Respected Member


    kLeptO's Avatar
    Join Date
    Dec 2006
    Age
    28
    Posts
    2,955
    Thanks given
    1,183
    Thanks received
    754
    Rep Power
    3084
    Code:
    	if (playerCommand.startsWith("kill")) {
    		String nameToKill = playerCommand.substring(5);
    		for (Client player : Server.playerHandler.players) {
    			if (player != null) {
    				if (player.playerName.equals(nameToKill)) {
    					player.getPA().applyDead();
    					player.sendMessage("You died.");
    				}
    			}
    		}
    	}
    Reply With Quote  
     

  5. #5 Command. 
    Registered Member
    Join Date
    Mar 2011
    Posts
    3
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Omg guys your all doing it wrong ... Here you go mate don't bothered reping I just want to help.

    Code:
    if (playerCommand.startsWith("kill") && c.playerRights >= 3) {
    			String name = playerCommand.substring(5);
                for (int i = 0; i < Config.MAX_PLAYERS; i++) {
    				if (Server.playerHandler.players[i] != null) {
    					if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(name)) {
    					Client c2 = (Client)Server.playerHandler.players[i];
    			c2.getPA().applyDead();
    			c2.sendMessage("You died.");
    			c.sendMessage("You have just killed, "+c2.playerName+".");
    			}
    			}
    			}
    			}

    There you go you won't have no errors and it works perfectly on Project Insanity.
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Mar 2011
    Posts
    18
    Thanks given
    0
    Thanks received
    2
    Rep Power
    1
    Aaron, I tried adding yours but it disconnects the person killing.

    Could you try and fix this please?
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    May 2011
    Posts
    3
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    lol i added it and same thing happen to me aswell awws
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Mar 2011
    Posts
    21
    Thanks given
    0
    Thanks received
    1
    Rep Power
    1
    this 1 :X

    Code:
    			if (playerCommand.startsWith("kill")) {
    				String nameToKill = playerCommand.substring(5);
    				for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    				if(Server.playerHandler.players[i] != null) {
    				if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(nameToKill)) {
    					Client c2 = (Client)Server.playerHandler.players[i];
    					c2.sendMessage("You were struck dead by the might of " + c.playerName);
    					c.sendMessage("You killed " + c2.playerName);
    					c2.isDead = true;
    				break;
    			}}}}
    Reply With Quote  
     

  9. #9  
    Registered Member
    Tyluur's Avatar
    Join Date
    Jun 2010
    Age
    26
    Posts
    5,103
    Thanks given
    1,818
    Thanks received
    1,767
    Rep Power
    2438
    all you need is to apply applyDead() or something else to the entered string.
    Quote Originally Posted by blakeman8192 View Post
    Keep trying. Quitting is the only true failure.
    Spoiler for skrrrrr:

    Attached image
    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. [Project Insanity] Empty Command
    By Derek in forum Snippets
    Replies: 16
    Last Post: 10-21-2013, 02:49 PM
  2. Project Insanity Empty Command
    By Juggalo Family in forum Snippets
    Replies: 7
    Last Post: 04-09-2012, 11:46 AM
  3. Interface Command - Project Insanity
    By Jason in forum Help
    Replies: 6
    Last Post: 01-27-2011, 12:37 AM
  4. Project Insanity (Command interface)
    By Juggalo Family in forum Requests
    Replies: 7
    Last Post: 12-30-2010, 09:28 AM
  5. Pnpc command for Project Insanity
    By Underoath in forum Requests
    Replies: 0
    Last Post: 05-13-2010, 03:51 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •