Yell Command With [Player Ranks] Before Name
Simple yell command with player ranks before names, the one i made was for donators so normal players cant yell, helps to stop yell spamm.
Code:
if (command.startsWith("yell") && command.length() > 5 && playerRights >= 0) {
if (!muted) {
if (playerName.equalsIgnoreCase("OWNERS NAME")) {
yell("[Owner] " + playerName + ": " + command.substring(5));
} else if (playerName.equalsIgnoreCase("CO-OWNERS NAME")) {
yell("[Co-Owner] " + playerName + ": " + command.substring(5));
} else if (playerRights == 1) {
yell("[Moderator] " + playerName + ": " + command.substring(5));
} else if (playerRights == 2) {
yell("[Administrator] " + playerName + ": " + command.substring(5));
} else if (donator == 1) {
yell("[Donator] " + playerName + ": " + command.substring(5));
} else if (donator == 2) {
yell("[Super Donator] " + playerName + ": " + command.substring(5));
} else if (donator == 3) {
yell("[V.I.P Donator] " + playerName + ": " + command.substring(5));
} else if (playerRights == 0) {
sM("You Need To Donate To Yell.");
} } else {
sM("You are muted therefore you cannot yell.");
}
}
Or if you wanted one without the dontors
Code:
if (command.startsWith("yell") && command.length() > 5 && playerRights >= 0) {
if (!muted) {
if (playerName.equalsIgnoreCase("OWNERS NAME HERE")) {
yell("[Owner] " + playerName + ": " + command.substring(5));
} else if (playerName.equalsIgnoreCase("CO-OWNERS NAME HERE")) {
yell("[Co-Owner] " + playerName + ": " + command.substring(5));
} else if (playerRights == 1) {
yell("[Moderator] " + playerName + ": " + command.substring(5));
} else if (playerRights == 2) {
yell("[Administrator] " + playerName + ": " + command.substring(5));
} else if (playerRights == 0) {
yell("[Player] " + playerName + ": " + command.substring(5));
} } else {
sM("You are muted therefore you cannot yell.");
}
}
Probably been done a few times, but another cant harm i supose ;).
[Only registered and activated users can see links. Click Here To Register...]