Thread: Easyer way to make Staff Handler..

Results 1 to 8 of 8
  1. #1 Easyer way to make Staff Handler.. 
    Registered Member Santa Noobie's Avatar
    Join Date
    Jan 2007
    Posts
    481
    Thanks given
    0
    Thanks received
    0
    Rep Power
    26
    People are asking me how to make admin.. or staf.. i just made this real quick to it would be easy for them...

    Purpose: Easyer way to make staff

    Hardness: 1-10

    Base: Any

    Credits: Me (Im hi123 on Mopar)

    Documents: Client.java, Server.java and StaffHandler.java

    First:

    - First make a new Notepad called "StaffHandler.java" Then add This in it:

    Code:
    	/*
             *  StaffHandler
    	 *  I made this because i was bored alright :P and its Sorta easyer.. Lol..
             */
    import java.io.*;
    
    public class StaffHandler { 
    
    	/*
             *  (C) Hi123
             */
    	
    	public StaffHandler()
    	{
    		//Nothing needs to be put in here
    	}
    
    public void process(int a){ // Playerright 3 means Owner, playerrights 2 Means Admin and 1 mean Mod. In the "" But the Players name
    
    client p = (client) server.playerHandler.players[a];
    if (p.playerName.equalsIgnoreCase("PLAYERNAME"))
    				{
    					p.playerRights = 3; 
    				}
       else if (p.playerName.equalsIgnoreCase("PLAYERNAME"))
    				{
    					p.playerRights = 2;
    				}
    else if (p.playerName.equalsIgnoreCase("PLAYERNAME"))
    				{
    					p.playerRights = 1;
    				}
    
    	}	
    }
    Where it says PLAYERNAME Add the Players Name.. Next Find "Start of mod" In client.java and you may Find:

    Code:
    checkmods();
    checkadmins();
    checkstaff();
    if(checkmods() == 5)
    playerRights = 1;
    if(checkadmins() == 5)
    playerRights = 2;
    Or Something like this..

    Code:
    if (playerName.equalsIgnoreCase(""))
    				{
    					playerRights = 3; 
    				}
       else if (playerName.equalsIgnoreCase(""))
    				{
    					playerRights = 2;
    				}
    else if (playerName.equalsIgnoreCase(""))
    				{
    					playerRights = 1;
    				}
    Replace it With this:

    Code:
    server.staffHandler.process(playerId);
    So it looks something like this..

    Code:
    //start of moderator/admin list, 1 = mod, 2 = staff, 3 = admin
    
    server.staffHandler.process(playerId);
    
    
    
    			if(playerId == -1) out.write(7);		// "This world is full."
    			else out.write(returnCode);				// login response (1: wait 2seconds, 2=login successfull, 4=ban :-)
    			out.write(playerRights);		// mod level
    			out.write(0);					// no log
    Next In Server.java find:

    Code:
    playerHandler = new PlayerHandler();
    Under That add:

    Code:
    staffHandler = new StaffHandler();
    And then Find:

    Code:
    public static ItemHandler itemHandler = null;
    And add this above it:

    Code:
    public static StaffHandler staffHandler = null;
    Done.. Nice and Simple.. Now just add the players name in StaffHandler..

    Credits: Me

    Did anyone else think this is a Cig or J
    <-- Rep If you support!
     

  2. #2  
    Registered Member
    Big J's Avatar
    Join Date
    Nov 2006
    Age
    31
    Posts
    512
    Thanks given
    0
    Thanks received
    0
    Rep Power
    143
    Nice work
    Latest

    Favorite

     

  3. #3  
    Duexes Ex
    Guest
    L2 name methods:
    Code:
    public StaffHandler()
    This should be:
    Code:
    public staffHandler()
    ---

    Avoid having 80 characters on one line, also it is recommended to use:

    Code:
    public void process(int a)
    {
    Instead of:
    Code:
    public void process(int a){ // Playerright 3 means Owner, playerrights 2 Means Admin and 1 mean Mod. In the "" But the Players name
    The output is horrible.
     

  4. #4  
    Im Insane
    P Hatz Own's Avatar
    Join Date
    Oct 2006
    Posts
    222
    Thanks given
    1
    Thanks received
    0
    Rep Power
    29
    You spelled staff wrong on the top.( Just a typo im guessing) Otherwise nice work =P


    Thanks.
     

  5. #5  
    Registered Member Santa Noobie's Avatar
    Join Date
    Jan 2007
    Posts
    481
    Thanks given
    0
    Thanks received
    0
    Rep Power
    26
    duexes.. it doesnt matter it works.. so.. yeah. first time poster?

    Did anyone else think this is a Cig or J
    <-- Rep If you support!
     

  6. #6  
    littleplop
    Guest
    what is wrong with you people, sorry but you do know that playey rights are in this order..

    o = basic player
    1 = player mod
    2 = Admin

    idk what this fixing the admin crown stuff is all about (not saying this tut) -but the values of your rights set for each name are above the right amount- because theres nothing wrong with it to fix.. but good job you can code lol!
     

  7. #7  
    Town
    Guest
    Uhm, i suppose i'l use this. Thanks.
     

  8. #8  
    Fasga
    Guest
    Quote Originally Posted by Santa Stick View Post
    duexes.. it doesnt matter it works.. so.. yeah. first time poster?
    By saying it doesn't matter, you're saying you're never going to care to maintain your own code. Trust me -- it does matter.
     


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: 5
    Last Post: 06-29-2010, 10:49 PM
  2. Replies: 3
    Last Post: 03-26-2009, 02:47 PM
  3. How to make a decent class file (handler)
    By Ashen Sky in forum Tutorials
    Replies: 12
    Last Post: 11-10-2008, 11:39 PM
  4. Replies: 3
    Last Post: 08-24-2008, 03:58 PM
  5. Sweet and simple way to make a handler
    By Harvey in forum Tutorials
    Replies: 24
    Last Post: 10-05-2007, 05:38 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
  •