Welcome!

Join our community of MMORPG enthusiasts and private server developers! By registering, you'll gain access to in-depth discussions on source codes, binaries, and the latest developments in MMORPG server files. Collaborate with like-minded individuals, explore tutorials, and share insights on building and optimizing private servers. Join us today and unlock the full potential of MMORPG server development!

Join Today!

Lithium GM Command Error

Skilled Illusionist
Joined
Dec 7, 2012
Messages
304
Reaction score
4
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.
 

Attachments

  • Gm Error - Lithium GM Command Error - RaGEZONE Forums
    Gm Error.webp
    45.8 KB · Views: 30
Back