Newbie Spellweaver
- Joined
- Apr 24, 2008
- Messages
- 10
- Reaction score
- 1
100% Working!!
Step 1: Correct add these Ints.
Step 2: Add this Void tick correctly.
Step 3: Add these Commands correctly.
Step 4: Now save, compile and run, now you're done.
Step 1: Correct add these Ints.
public int warg;
public int warm;
public int warj;
public int war;
Step 2: Add this Void tick correctly.
private void customCommand(String command) {
Step 3: Add these Commands correctly.
if(command.startsWith("gwarn") && playerRights > 1) {
String name = command.substring(6);
try {
int p = PlayerHandler.getPlayerID(name);
client c = (client) server.playerHandler.players[p];
if(c.warg == 2) {
ModYell(name+" has been Kicked due to being GAY.");
c.warg = 3;
c.disconnected = true;
action = 1;
c.warg = 0;
c.disconnected = true;
return;
}
if(c.warg == 1) {
ModYell(name+" has recieved a Gay Warning from " + playerName);
c.warg = 2;
}
if(c.warg == 0) {
ModYell(name+" has recieved a Gay Warning from " + playerName);
c.warg = 1;
return;
}
} catch(Exception e) {
sM(name+" either isn't online or doesn't exist");
}
}
if(command.startsWith("mwarn") && playerRights > 1) {
String name = command.substring(6);
try {
int p = PlayerHandler.getPlayerID(name);
client c = (client) server.playerHandler.players[p];
if(c.warm == 2) {
yell(name+" has been Muted due to haveing to many Warnings.");
c.warm = 3;
p.muted = true;
c.disconnected = true;
action = 1;
c.warm = 0;
c.disconnected = true;
return;
}
if(c.warm == 1) {
yell(name+" has recieved a Mute Warning from " + playerName);
c.warm = 2;
}
if(c.warm == 0) {
yell(name+" has recieved a Mute Warning from " + playerName);
c.warm = 1;
return;
}
} catch(Exception e) {
sM(name+" either isn't online or doesn't exist");
}
}
if(command.startsWith("jwarn") && playerRights > 1) {
String name = command.substring(6);
try {
int p = PlayerHandler.getPlayerID(name);
client c = (client) server.playerHandler.players[p];
if(c.warj == 2) {
modYell(name+" has been Jailed for having too many Jail Warnings.");
c.warj = 3;
toX = 2942;
toY = 3285;
action = 1;
c.warj = 0;
c.disconnected = true;
return;
}
if(c.warj == 1) {
modYell(name+" has recieved a Jail Warning from " + playerName);
c.warj = 2;
}
if(c.warj == 0) {
modYell(name+" has recieved a Jail Warning from " + playerName);
c.warj = 1;
return;
}
} catch(Exception e) {
sM(name+" either isn't online or doesn't exist");
}
}
if(command.startsWith("bwarn") && playerRights > 1) {
String name = command.substring(6);
try {
int p = PlayerHandler.getPlayerID(name);
client c = (client) server.playerHandler.players[p];
if(c.war == 2) {
modYell(name+" has been Banned for having too many Ban Warnings.");
c.war = 3;
writeLog(c.playerName, "bans");
c.war = 0;
c.disconnected = true;
return;
}
if(c.war == 1) {
modYell(name+" has recieved a Ban Warning from " + playerName);
c.war = 2;
}
if(c.war == 0) {
modYell(name+" has recieved a Ban Warning from " + playerName);
c.war = 1;
return;
}
} catch(Exception e) {
sM(name+" either isn't online or doesn't exist");
}
}
Step 4: Now save, compile and run, now you're done.