Mine should work fine. There's nothing wrong and I updated to your preferences.
Add this into PlayerCommands.java
Code:public static class GM extends CommandExecute { public int execute(MapleClient c, String[] splitted) { final int delayMin = 0;//This is the delay between players can use @GM command in Minutes MapleCharacter player = c.getPlayer(); if (System.currentTimeMillis() - player.getGMTime() >= (delayMin * 60000)) { World.Broadcast.broadcastGMMessage(CWvsContext.serverNotice(6,"Channel " + c.getPlayer().getClient().getChannel() + " // " + c.getPlayer().getName() + ": " + StringUtil.joinStringFrom(splitted, 1))); player.setGMTime(); } player.dropMessage(5, "Your message has been sent."); } else { final long timeLeft = delayMin * 60000 - (System.currentTimeMillis() - player.getGMTime()); player.dropMessage(5, "Sorry, but you have to wait " + (timeLeft/1000) + " before you can use this command again"); } return 1; } }
Add into MapleCharacter.java
Code:private long gmtime = 0;
Code:public long getGMTime(){ return gmtime; } public void setGMTime(){ this.gmtime = System.currentTimeMillis(); }
So practically I went and found someone Post and a release of the GM command on here, but I attempted to do it and I'm constantly getting error and I tried fixing it but got no where, So not sure what to do precisely. If anyone can tell me why it be nice.
I'm also not sure but I'm sure this is where I should of placed it in MapleCharacter but tell me if I'm wrong in it as well.