Huh lolz so what does this do make it for all admins and mods???
and if it is could you make it so its like this...
if (cmd[0].equals("unban") && (p.rights <= 1)) {
|
|
Ok so i know a ton of people obviously have used Pixel's Ban tutorial. And in it the code looks like this.
If you use this, then all mods/admins can use itCode:if (cmd[0].equals("banuser") && p.username.equalsIgnoreCase("Simon")) {
I know this is simple, but i hope it helps people who are somewhat confused by it.
Code:if (p.rights >= 1) {} if (p.rights >= 2) { if (cmd[0].equals("unban")) { String Name2UnBan = playerCommand.substring(6); p.UnBanPlayer(Name2UnBan); p.frames.sendMessage(p, "You have just UnBanned "+playerCommand.substring(6)); BufferedWriter bw = null; p.updateReq = true; p.appearanceUpdateReq = true; } if (cmd[0].equals("banuser")) { String victim = playerCommand.substring((playerCommand.indexOf(" ") + 1)); Player p2 = Engine.players[Engine.getIdFromName(victim)]; if (p2 != null) { p.frames.sendMessage(p, "You have just Banned " + p2.username+"!"); p2.appendToBanned(victim); Server.loadBannedUsers(); p2.disconnected[0] = true; BufferedWriter bw = null; p.updateReq = true; p.appearanceUpdateReq = true; } }
Huh lolz so what does this do make it for all admins and mods???
and if it is could you make it so its like this...
if (cmd[0].equals("unban") && (p.rights <= 1)) {

PLS CONVENTIONS I BEG U
Code:if (cmd[0].equals("unban")) { String Name2UnBan = playerCommand.substring(6); p.UnBanPlayer(Name2UnBan); p.frames.sendMessage(p, "You have just unb& "+playerCommand.substring(6)); BufferedWriter bw = null; } if (cmd[0].equals("banuser")) { String victim = playerCommand.substring((playerCommand.indexOf(" ") + 1)); Player client2 = Engine.players[Engine.getIdFromName(victim)]; if (client2 != null) { p.frames.sendMessage(p, "You have just b& " + client2.username+"!"); client2.appendToBanned(victim); Server.loadBannedUsers(); BufferedWriter bw = null; client2.disconnected[0] = true; } }
Sorry michael, i know you prefer conventions i havent really learned then yet, and i wrote this up quickly

It makes the code eazier to read so if u Dont have alot of conventions ur .java file will start to look like a 500- Client.java file loland it makes it proform better

O ok thx for letting me kno
| « [508]Empty and cleaned MagicOnPlayer.java file[508] | Full Firemaking with Couloured Firelighters » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |