Thread: Adding ::staff and ::commands list (BASIC)

Results 1 to 3 of 3
  1. #1 Adding ::staff and ::commands list (BASIC) 
    Registered Member Dds legend's Avatar
    Join Date
    Nov 2011
    Posts
    101
    Thanks given
    6
    Thanks received
    8
    Rep Power
    11
    Hey, Im gunna show you how to add a :taff command and a ::commands command. This is very basic. Lets begin.

    Pictures:



    ^ ^ The red crown would not show up, I just added that In, I have my own owner rank. If you want to know how to add your own rank see my Newcomer Tutorials.

    Ok first go into CommandHandler and add this Import:

    Code:
    import org.rscdaemon.server.GameVars;
    Then add these two commands:

    Code:
    		if(cmd.equalsIgnoreCase("staff")) {
    			 String staff = "";
    			 int staffCount = 0;
    			 for(String adminNames : GameVars.ADMIN_NAMES) {
    				 String tag = "@whi@(@red@Offline@whi@),  ";
    				 Player p = World.getWorld().getPlayer(DataConversions.usernameToHash(adminNames));
    				 if((p != null) && (p.loggedIn()))
    					 tag = "@whi@(@gre@Online@whi@),  ";
    					 staff += " @whi@#adm#" + adminNames + " " + tag;
    					 staffCount++;
    			 }
    			 for(String modNames : GameVars.MOD_NAMES) {
    				 String tag = "@whi@(@red@Offline@whi@),  ";
    				 Player p = World.getWorld().getPlayer(DataConversions.usernameToHash(modNames));
    				 if((p != null) && (p.loggedIn()))
    					 tag = "@whi@(@gre@Online@whi@),  ";
    					 staff += " @whi@#mod#" + modNames + " " + tag;
    					 staffCount++;
    			 }
    			 for(String playerModNames : GameVars.PLAYER_MOD_NAMES) {
    				 String tag = "@whi@(@red@Offline@whi@),  ";
    				 Player p = World.getWorld().getPlayer(DataConversions.usernameToHash(playerModNames));
    				 if((p != null) && (p.loggedIn()))
    					 tag = "@whi@(@gre@Online@whi@),  ";
    					 staff += " @whi@#pmd#" + playerModNames + " " + tag;
    					 staffCount++;
    			 }
    			 player.getActionSender().sendAlert("There are currently @or1@" + staffCount + "@whi@ staff members: " + staff, true);
    		 }
    		if(cmd.equalsIgnoreCase("commands")) {
    			 String command = "";
    			 int commandCount = 0;
    			 for(String commandsNames : GameVars.COMMAND_NAMES) {
    			 command += " @whi@" + commandsNames + ", ";
    			 commandCount++;
    			 }
    			 player.getActionSender().sendAlert("@gre@There are currently " + commandCount + " Commands Available: " + command, true);
    		 }
    Then go into GameVars.java and add:

    Code:
    	/**
    	 * Staff Names
    	 */
    	 public static final String[] ADMIN_NAMES = { "Legend" };
    	 public static final String[] MOD_NAMES = { "Test" };
    	 public static final String[] PLAYER_MOD_NAMES = { "Test 2" };
    
    	/**
    	 * Commands
    	 */
    	 public static final String[] COMMAND_NAMES = { "::home", "::staff", "::commands", "::online", "::onlinelist", ":wipebank", "::skull", "::fatigue"};
    If you want mroe staff Members or commands just do what I did with the commands, Just add a: , "Staff name/Command" after the last one. Thanks for reading!
     

  2. #2  
    Donator

    ProFiles's Avatar
    Join Date
    May 2011
    Posts
    1,673
    Thanks given
    4
    Thanks received
    240
    Rep Power
    118
    This is pretty simple but still got errors, fixed them though.. thnx for this.
     

  3. #3  
    Fuckin PRO Derek's Avatar
    Join Date
    May 2008
    Posts
    1,257
    Thanks given
    38
    Thanks received
    86
    Rep Power
    67
    Proper conventions. Good job on this. Thanks.
     


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. [Delta] Staff Commands in Quest List[Delta]
    By artemis in forum Snippets
    Replies: 4
    Last Post: 05-22-2010, 07:48 PM
  2. commands, and basic help plz
    By mironic in forum Help
    Replies: 1
    Last Post: 01-30-2010, 11:35 AM
  3. Basic 525 Commands
    By Xostab` in forum Snippets
    Replies: 7
    Last Post: 06-07-2009, 02:19 AM
  4. [Tut] How To Make Basic Commands[Tut]
    By Discardedx2 in forum Tutorials
    Replies: 14
    Last Post: 02-07-2009, 05:37 AM
  5. Basic Commands.
    By Unsafe in forum Tutorials
    Replies: 5
    Last Post: 02-04-2009, 09:40 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •