Thread: Making title command stop at 100?

Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1 Making title command stop at 100? 
    Chow down on these noodles
    OodlesOfNoodles's Avatar
    Join Date
    May 2011
    Posts
    1,819
    Thanks given
    235
    Thanks received
    91
    Rep Power
    55
    I want to limit this command for players to not be able to give them a title past 100.
    Code:
    			
    			if (cmd[0].equals("title")) {
    				if (cmd.length < 2) {
    					player.getPackets().sendGameMessage("Use: ::title id");
    					return true;
    				}
    				try {
    					player.getAppearence().setTitle(Integer.valueOf(cmd[1]));
    				} catch (NumberFormatException e) {
    					player.getPackets().sendGameMessage("Use: ::title id");
    				}
    				return true;
    			}
    Like it not give them a title past ::title 99
    How would I set this up
    Reply With Quote  
     

  2. #2  
    Project Drop-Zone Owner & The BLOOD Gang Always Banging RED


    Join Date
    May 2013
    Age
    28
    Posts
    2,992
    Thanks given
    5
    Thanks received
    937
    Rep Power
    183
    if (cmd.length < 2) {

    Under that you would have to make a method for it to go from 1-99. Trying to think of a way you can do it
    Reply With Quote  
     

  3. #3  
    Chow down on these noodles
    OodlesOfNoodles's Avatar
    Join Date
    May 2011
    Posts
    1,819
    Thanks given
    235
    Thanks received
    91
    Rep Power
    55
    I know, I'm trying to find another command with a method that does the same thing but not having any luck yet :c
    Reply With Quote  
     

  4. #4  
    Project Drop-Zone Owner & The BLOOD Gang Always Banging RED


    Join Date
    May 2013
    Age
    28
    Posts
    2,992
    Thanks given
    5
    Thanks received
    937
    Rep Power
    183
    Quote Originally Posted by Pastaway View Post
    I know, I'm trying to find another command with a method that does the same thing but not having any luck yet :c
    There is a command maker tool out there that may be able to help you check the tools section . Is this used for user titles in game? If so why not just make it a interface
    Reply With Quote  
     

  5. #5  
    Chow down on these noodles
    OodlesOfNoodles's Avatar
    Join Date
    May 2011
    Posts
    1,819
    Thanks given
    235
    Thanks received
    91
    Rep Power
    55
    I have an interface for it also, this is just for super donors to be able to set their own command at any time, I just don't want them setting theirs to owner,admin,dicer and a couple other titles at 100+

    Nevermind. I just set the owner titles and stuff to a ridiculously high number
    Reply With Quote  
     

  6. #6  
    Registered Member
    Velocity's Avatar
    Join Date
    Jan 2009
    Age
    28
    Posts
    2,028
    Thanks given
    1,013
    Thanks received
    2,376
    Rep Power
    4112
    Math.min(99, input);
    xxxxxxx
    Reply With Quote  
     

  7. #7  
    Banned
    Join Date
    Jun 2013
    Posts
    202
    Thanks given
    72
    Thanks received
    74
    Rep Power
    0
    Do you even know basics of programming?

    Code:
    			
    			if (cmd[0].equals("title")) {
    				try {
    					int titleIdx = Integer.valueOf(cmd[1]);   
    				} catch (NumberFormatException e) {
    					player.getPackets().sendGameMessage("Use: ::title id");
    				}				
    				if (cmd.length < 2) {
    					player.getPackets().sendGameMessage("Use: ::title id");
    					return true;
    				}
    				if (titleIdx <= 100) {
    					player.getAppearence().setTitle(Integer.valueOf(cmd[1]));
    				} else {
    					player.getPackets().sendGameMessage("You can not set a title with a higher value than 100");
    					return true;
    				}
    				return true;
    			}
    Reply With Quote  
     

  8. #8  
    Banned

    Join Date
    Dec 2011
    Posts
    967
    Thanks given
    234
    Thanks received
    208
    Rep Power
    0
    Quote Originally Posted by MOB KLICK View Post
    if (cmd.length < 2) {

    Under that you would have to make a method for it to go from 1-99. Trying to think of a way you can do it
    Wtf....

    Just add something like

    Code:
    if (titleIdx > 100)
    return;
    Under where it declares and initializes int titleIdx
    Reply With Quote  
     

  9. #9  
    Chow down on these noodles
    OodlesOfNoodles's Avatar
    Join Date
    May 2011
    Posts
    1,819
    Thanks given
    235
    Thanks received
    91
    Rep Power
    55
    Quote Originally Posted by Velocity View Post
    Math.min(99, input);
    I have it set up like this:
    Code:
    			
    			if (cmd[0].equals("title")) {
    				if (cmd.length < 2) {
    					int input = 0;
    					Math.min(99, input);
    					player.getPackets().sendGameMessage("Use: ::title id");
    					return true;
    				}
    				try {
    					player.getAppearence().setTitle(Integer.valueOf(cmd[1]));
    				} catch (NumberFormatException e) {
    					player.getPackets().sendGameMessage("Use: ::title id");
    				}
    				return true;
    			}
    that didn't work though:c
    Reply With Quote  
     

  10. #10  
    Chow down on these noodles
    OodlesOfNoodles's Avatar
    Join Date
    May 2011
    Posts
    1,819
    Thanks given
    235
    Thanks received
    91
    Rep Power
    55
    Quote Originally Posted by OS Rsps View Post
    Do you even know basics of programming?

    Code:
    			
    			if (cmd[0].equals("title")) {
    				try {
    					int titleIdx = Integer.valueOf(cmd[1]);   
    				} catch (NumberFormatException e) {
    					player.getPackets().sendGameMessage("Use: ::title id");
    				}				
    				if (cmd.length < 2) {
    					player.getPackets().sendGameMessage("Use: ::title id");
    					return true;
    				}
    				if (titleIdx <= 100) {
    					player.getAppearence().setTitle(Integer.valueOf(cmd[1]));
    				} else {
    					player.getPackets().sendGameMessage("You can not set a title with a higher value than 100");
    					return true;
    				}
    				return true;
    			}
    Didn't work. And no I don't know the basics of programming or else I wouldn't be in the help section lol
    Reply With Quote  
     

Page 1 of 2 12 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. (NOOB) Making tele commands (NOOB)
    By -owned- in forum Tutorials
    Replies: 11
    Last Post: 02-19-2008, 11:45 AM
  2. Making Full Commands(Fully Exsplained)
    By Jordzeh in forum Tutorials
    Replies: 18
    Last Post: 01-13-2008, 02:33 PM
  3. [Req] How do you make a tab tele at a level [Req]
    By o0x vvv x0o in forum Tutorials
    Replies: 5
    Last Post: 10-23-2007, 11:27 AM
  4. Making Yell command log to a seperate file
    By DegeneralizationX in forum Tutorials
    Replies: 8
    Last Post: 10-04-2007, 05:20 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
  •