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