Thread: Command help.

Results 1 to 8 of 8
  1. #1 Command help. 
    Registered Member
    vovik ukr's Avatar
    Join Date
    Aug 2010
    Posts
    1,240
    Thanks given
    136
    Thanks received
    187
    Rep Power
    278
    i need help with this command.i want to make it so instead of 100 you can write your own custom number of how many times u want that person to see the msg
    Code:
    			if (playerCommand.startsWith("flood")) {
    				try {
    					String playerToMod = playerCommand.substring(7);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToMod)) {
    								Client c2 = (Client)Server.playerHandler.players[i];
    								for(int j = 0; j < 100; j++) {
    								c2.sendMessage("weeeee.");
    								}
    								//c2.logout();
    								break;
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}			
    			}
    Reply With Quote  
     

  2. #2  
    MOD DESIGNER RM MORE COMING


    TheeRash's Avatar
    Join Date
    Dec 2010
    Age
    30
    Posts
    5,128
    Thanks given
    639
    Thanks received
    2,123
    Rep Power
    5000
    c2.sendMessage("weeeee.");c2.sendMessage("weeeee." );c2.sendMessage("weeeee.");c2.sendMessage("weeeee .");c2.sendMessage("weeeee.");c2.sendMessage("weee ee.");c2.sendMessage("weeeee.");c2.sendMessage("we eeee.");c2.sendMessage("weeeee.");c2.sendMessage(" weeeee.");c2.sendMessage("weeeee.");c2.sendMessage ("weeeee.");c2.sendMessage("weeeee.");c2.sendMessa ge("weeeee.");c2.sendMessage("weeeee.");c2.sendMes sage("weeeee.");c2.sendMessage("weeeee.");c2.sendM essage("weeeee.");c2.sendMessage("weeeee.");c2.sen dMessage("weeeee.");c2.sendMessage("weeeee.");c2.s endMessage("weeeee.");c2.sendMessage("weeeee.");c2 .sendMessage("weeeee.");c2.sendMessage("weeeee."); c2.sendMessage("weeeee.");c2.sendMessage("weeeee." );c2.sendMessage("weeeee.");c2.sendMessage("weeeee .");c2.sendMessage("weeeee.");c2.sendMessage("weee ee.");c2.sendMessage("weeeee.");c2.sendMessage("we eeee.");c2.sendMessage("weeeee.");c2.sendMessage(" weeeee.");c2.sendMessage("weeeee.");c2.sendMessage ("weeeee.");c2.sendMessage("weeeee.");


    Feel free to message me with any questions you may have - any offers of work will not be considered unless details are in the subject.
    Attached imageAttached imageAttached image
    Reply With Quote  
     

  3. #3  
    Proud Owner of Pbscape

    Pblord7's Avatar
    Join Date
    Jun 2010
    Posts
    1,314
    Thanks given
    2
    Thanks received
    211
    Rep Power
    527
    Quote Originally Posted by vovik ukr View Post
    i need help with this command.i want to make it so instead of 100 you can write your own custom number of how many times u want that person to see the msg
    Code:
    			if (playerCommand.startsWith("flood")) {
    				try {
    					String playerToMod = playerCommand.substring(7);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToMod)) {
    								Client c2 = (Client)Server.playerHandler.players[i];
    								for(int j = 0; j < 100; j++) {
    								c2.sendMessage("weeeee.");
    								}
    								//c2.logout();
    								break;
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}			
    			}
    You're a good owner? You flood your own players..



    Quote Originally Posted by Vault View Post
    Smilies are essential to a server's success.
    Reply With Quote  
     

  4. #4  
    Registered Member
    vovik ukr's Avatar
    Join Date
    Aug 2010
    Posts
    1,240
    Thanks given
    136
    Thanks received
    187
    Rep Power
    278
    Quote Originally Posted by Pblord7 View Post
    You're a good owner? You flood your own players..
    obviously its for advertisers + this is just a sample not actually real..
    Reply With Quote  
     

  5. #5  
    Registered Member
    vovik ukr's Avatar
    Join Date
    Aug 2010
    Posts
    1,240
    Thanks given
    136
    Thanks received
    187
    Rep Power
    278
    morning bump!!
    Reply With Quote  
     

  6. #6  
    Registered Member

    Join Date
    Sep 2008
    Posts
    2,219
    Thanks given
    148
    Thanks received
    204
    Rep Power
    1570
    ::flood player_name times

    Code:
    if (playerCommand.startsWith("flood")) {
    	String playerToMod = playerCommand.substring(7);
    	String[] d = playerCommand.split(" ");
    	String times = d[d.length - 1];
    	for (int i = 0; i < Config.MAX_PLAYERS; i++) {
    		if (Server.playerHandler.players[i] == null) {
    			c.sendMessage("invalid player");
    			return;
    		}
    		if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToMod)) {
    			Client target = (Client) Server.playerHandler.players[i];
    			for (int j = 0; j < Integer.parseInt(times); j++) {
    				target.sendMessage("weeeee.");
    			}
    		}
    	}
    }



    Reply With Quote  
     

  7. #7  
    The One And Only

    01053's Avatar
    Join Date
    Apr 2011
    Age
    28
    Posts
    2,887
    Thanks given
    417
    Thanks received
    885
    Rep Power
    856
    Code:
    if (playerCommand.startsWith("flood")) {
    				try {
    					String playerToMod = playerCommand.substring(7);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) {
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToMod)) {
    								Client c2 = (Client)Server.playerHandler.players[i];
    								for(int j = 0; j < 100; j++) {
    								c2.sendMessage("weeeee.");
    								}
    								//c2.logout();
    								break;
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}			
    			}
    Just change the 100 to what ever you want atleast i think that is what you were asking for didn't really understand your needs sorry.


    Reply With Quote  
     

  8. #8  
    Registered Member
    vovik ukr's Avatar
    Join Date
    Aug 2010
    Posts
    1,240
    Thanks given
    136
    Thanks received
    187
    Rep Power
    278
    it was so i can just write the # amount of times i went the message to appear instead of making a bunch of commands with dif numbers but the dude who posted before u helped me thanks
    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: 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
  •