zenthosDev Commands dont work...
well i have created my server but there is aproblem in the Gm commands
here is my "CommandProcessor.Java" can any one tell me what's wrong in here ?
Code:
package client.messages;
import client.MapleClient;
import client.messages.commands.Admins;
import client.messages.commands.Donator;
import client.messages.commands.Extras;
import client.messages.commands.GM;
import client.messages.commands.PlayerCommands;
public class CommandProcessor {
private static CommandProcessor instance = new CommandProcessor();
private final char SGM = '!', Player = '@';
public static CommandProcessor getInstance() {
return instance;
}
private CommandProcessor() {
instance = this;
}
public boolean isCommand(MapleClient c, String line, char charZero, boolean isGM) {
String[] splitted = line.split(" ");
String command = splitted[0].substring(1).toLowerCase();
if (charZero != SGM && charZero != Player) {
return false;
}
if (splitted[0].length() < 2) {
return false;
}
if (splitted[0].charAt(1) == SGM) {
return false;
}
if (splitted[0].charAt(1) == Player) {
return false;
}
if (!Command.isCommand(command, charZero, isGM)) {
return false;
}
if (c.getPlayer().getAntiCheats().Spam(1000, 7)) {
c.getPlayer().dropMessage(1, "Please try again later.");
return true;
}
return instance.processCommand(c, splitted, command, charZero);
}
private boolean processCommand(MapleClient c, String[] splitted, String command, char charZero) {
int cGML = c.getPlayer().getGMLevel();
try {
if (charZero == SGM) {
if (Command.findCommand(4, command, cGML, 3)) {
if (c.getAccID() != 1) {
System.out.println("Notice: " + c.getPlayer().getName() + " used a command: !" + command);
}
Admins.execute(c, splitted, command);
return true;
} else if (Command.findCommand(3, command, cGML, 2)) {
GM.execute(c, splitted, command);
return true;
} else if (Command.findCommand(2, command, cGML, 1)) {
Donator.execute(c, splitted, command);
return true;
} else {
return false;
}
} else {
if (Command.findCommand(1, command, cGML, 0)) {
Extras.execute(c, splitted, command);
return true;
} else if (Command.findCommand(0, command, cGML, 0)) {
PlayerCommands.execute(c, splitted, command);
return true;
} else {
return false;
}
}
} catch (Exception e) {
System.out.println("Command Error: " + charZero + command + ": " + e);
}
return false;
}
}
Solved:
Quote:
Fix:
in SQL
just make sure that in account's table has GM: 1 in your account and in characters you have GM: 3 Done ;)
Re: zenthosDev Commands dont work...
Does your character have the required GMlevel to use the GM commands?
Re: zenthosDev Commands dont work...
Quote:
Originally Posted by
The Sharingan
Does your character have the required GMlevel to use the GM commands?
sure lv 3 it is...
Re: zenthosDev Commands dont work...
Quote:
Originally Posted by
Dor Maudi
sure lv 3 it is...
I've never used this source before, but try lv 5 or 6.
Re: zenthosDev Commands dont work...
Quote:
Originally Posted by
sonnyeb
I've never used this source before, but try lv 5 or 6.
tried it never worked...
Re: zenthosDev Commands dont work...
Quote:
Originally Posted by
Dor Maudi
tried it never worked...
Did you make sure to set it in Characters and not (only) in accounts?
Re: zenthosDev Commands dont work...
Quote:
Originally Posted by
The Sharingan
Did you make sure to set it in Characters and not (only) in accounts?
possative i did changed them both to 3 and every command that i tried didnt worked..
Re: zenthosDev Commands dont work...
problem solved ;)
Fix:
in SQL
just make sure that in account's you have in GM: 1 and in characters you have GM: 3 Done ;)