Thread: [PI] Kill Command

Results 1 to 2 of 2
  1. #1 [PI] Kill Command 
    I'm President Carter


    Join Date
    Jan 2011
    Posts
    1,204
    Thanks given
    17
    Thanks received
    222
    Rep Power
    144
    Base: PI/DSPK

    Problem: I need a working kill command so when you do ::kill (playername) it kills them.

    Compiling Errors: none

    Other info: none


    Reply With Quote  
     

  2. #2  
    Registered Member
    Gator God's Avatar
    Join Date
    Aug 2010
    Posts
    260
    Thanks given
    15
    Thanks received
    26
    Rep Power
    99
    Code:
    					if (playerCommand.startsWith("kill")) {
    				try {	
    					String playerToKill = 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(playerToKill)) {
    								c.sendMessage("You have killed the user: "+Server.playerHandler.players[i].playerName);
    								Client c2 = (Client)Server.playerHandler.players[i];
    								c2.isDead = true;
    								break;
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.);
    				}			
    			}
    Quote Originally Posted by H A W X;
    [IMG]C:\Users\R\Desktop\Rune-Server\Pictures[/IMG]
    :trollface:
    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. Need a ::kill command.
    By Logisti-X in forum Help
    Replies: 11
    Last Post: 01-14-2010, 07:57 PM
  2. Kill Command for Delta L!O!L
    By LARDI in forum Show-off
    Replies: 9
    Last Post: 05-22-2009, 08:09 PM
  3. Kill Command for Delta
    By LARDI in forum Help
    Replies: 0
    Last Post: 05-15-2009, 04:24 AM
  4. Kill Command (explained)
    By Nets8 in forum Tutorials
    Replies: 34
    Last Post: 02-23-2008, 02:01 PM
  5. Kill someone (With a command!)
    By i hazy i in forum Tutorials
    Replies: 9
    Last Post: 02-17-2008, 03:48 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
  •