How would one save occupation skills into the database (MySQL)? It works when the player is changing channel or going into Cash Shop and all but once I relog it refreshes and becomes spammable because relogging can always reset it. I have the command:
PHP Code:if (!c.getPlayer().getCheatTracker().SmegaSpam(15000, 2)) {
if (c.getPlayer().haveItem(5072000, 1, true, true)) {
c.getPlayer().getClient().getChannelServer().broadcastPacket(CWvsContext.serverNotice(3, c.getChannel(), sb.toString()));
MapleInventoryManipulator.removeById(c, MapleInventoryType.CASH, 5072000, 1, true, true);
} else {
c.getPlayer().dropMessage("You do not have a megaphone to use this command.");
}
} else {
c.getPlayer().dropMessage("You need to wait every 15 seconds before using this command again!");
}
The SmegaSpam prevents them from spamming/using the command repeatedly even if they CC or enter cash shop. Once someone relogs they can use the command again like SmegaSpam doesn't exist.PHP Code:public synchronized boolean SmegaSpam(int limit, int type) {
if (type < 0 || lastTime.length < type) {
type = 1; // Default numbuh
}
if (System.currentTimeMillis() < limit + lastTime[type]) {
return true;
}
lastTime[type] = System.currentTimeMillis();
return false;
}



Reply With Quote![[Help] Occupation Skills](http://ragezone.com/hyper728.png)


