Thread: [PI] Need help with a command

Page 1 of 3 123 LastLast
Results 1 to 10 of 25
  1. #1 [PI] Need help with a command 
    Proud User
    Join Date
    Feb 2011
    Posts
    530
    Thanks given
    69
    Thanks received
    28
    Rep Power
    29
    Hey guys was just wondering is there a way to make a command something like ::Givepkp (username) and gives them PK points, I did use the search Button and googled it, couldnt find nothing, so could someone help me out?
    Reply With Quote  
     

  2. #2  
    Extreme Donator

    Jilic-Matt's Avatar
    Join Date
    May 2011
    Age
    29
    Posts
    1,612
    Thanks given
    799
    Thanks received
    494
    Rep Power
    540
    lol this is piss gimme a min xD
    Reply With Quote  
     

  3. #3  
    Proud User
    Join Date
    Feb 2011
    Posts
    530
    Thanks given
    69
    Thanks received
    28
    Rep Power
    29
    Omg your god
    Reply With Quote  
     

  4. #4  
    Donator


    Join Date
    Jun 2011
    Posts
    2,549
    Thanks given
    539
    Thanks received
    402
    Rep Power
    683
    Lol are you joking me, come on now man, add pkp then send and save through character files.
    All the best,
    Nirvana

    Reply With Quote  
     

  5. #5  
    Proud User
    Join Date
    Feb 2011
    Posts
    530
    Thanks given
    69
    Thanks received
    28
    Rep Power
    29
    Nope not joking wouldnt be posting it here if it was?
    Reply With Quote  
     

  6. #6  
    Proud User
    Join Date
    Feb 2011
    Posts
    530
    Thanks given
    69
    Thanks received
    28
    Rep Power
    29
    Bump can anyone still help?
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    May 2009
    Posts
    844
    Thanks given
    44
    Thanks received
    39
    Rep Power
    29
    Use the givestaff command, and turn the c2.playerRights into c2.pkp or something like that!
    Reply With Quote  
     

  8. #8  
    Donator


    Join Date
    Mar 2011
    Posts
    2,350
    Thanks given
    1,193
    Thanks received
    824
    Rep Power
    856
    Code:
    if (playerCommand.startsWith("givepkp") && playerCommand.charAt(10) == ' ') {
    			try {	
    				String playerToG = playerCommand.substring(10);
    				for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    					if(Server.playerHandler.players[i] != null) {
    						if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToG)) {
    							Server.playerHandler.players[i].pkp += 35;
    							c.sendMessage("You have given  "+Server.playerHandler.players[i].playerName+" x pkp points: "+Server.playerHandler.players[i].connectedFrom);							
    						} 
    					}
    				}
    			} catch(Exception e) {
    				c.sendMessage("Player Must Be Offline.");
    			}
    		}
    Don't post if you're not going to help.
    Reply With Quote  
     

  9. #9  
    Banned
    Join Date
    Sep 2011
    Posts
    20
    Thanks given
    0
    Thanks received
    6
    Rep Power
    0
    ^ ew. Don't post if you don't know how to program.
    looks like you didn't search..
    Code:
    			if(playerCommand.startsWith("givepoints") && c.playerRights == 3) {
    				try {
    					String[] args = playerCommand.split(" ", 2);
    					String otherplayer = args[1];
    					int point = Integer.parseInt(args[2]);
    						for(int i = 0; i < PlayerHandler.players.length; i++) {
    							if(PlayerHandler.players[i] != null) {
    								if(PlayerHandler.players[i].playerName.equalsIgnoreCase(otherplayer)) {
    								Client c2 = (Client)PlayerHandler.players[i];
    									c2.magePoints += point;
    									c.sendMessage("@blu@You have given "+otherplayer+", "+point+" Reward points.");
    									c2.sendMessage("@red@You have been given "+point+" Reward points by "+c.playerName+".");
    								}
    							}
    						}
    					} catch(Exception e) {
    						c.sendMessage("Wrong syntax! ::givepoints name amount");
    				}
    			}
    http://www.rune-server.org/runescape...ivepoints.html
    Reply With Quote  
     

  10. #10  
    Donator


    Join Date
    Mar 2011
    Posts
    2,350
    Thanks given
    1,193
    Thanks received
    824
    Rep Power
    856
    Quote Originally Posted by TROLL_U_MUCH View Post
    ^ ew. Don't post if you don't know how to program.
    looks like you didn't search..
    Code:
    			if(playerCommand.startsWith("givepoints") && c.playerRights == 3) {
    				try {
    					String[] args = playerCommand.split(" ", 2);
    					String otherplayer = args[1];
    					int point = Integer.parseInt(args[2]);
    						for(int i = 0; i < PlayerHandler.players.length; i++) {
    							if(PlayerHandler.players[i] != null) {
    								if(PlayerHandler.players[i].playerName.equalsIgnoreCase(otherplayer)) {
    								Client c2 = (Client)PlayerHandler.players[i];
    									c2.magePoints += point;
    									c.sendMessage("@blu@You have given "+otherplayer+", "+point+" Reward points.");
    									c2.sendMessage("@red@You have been given "+point+" Reward points by "+c.playerName+".");
    								}
    							}
    						}
    					} catch(Exception e) {
    						c.sendMessage("Wrong syntax! ::givepoints name amount");
    				}
    			}
    http://www.rune-server.org/runescape...ivepoints.html


    It's funny when you had to search for yours and this requires no programming. It's common sense. Mine's shorter and more efficient.
    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: 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: 4
    Last Post: 02-13-2009, 12:32 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
  •