תנסה להחליף את הפקודה !removeplayernpcs בזה:
קוד PHP:
} else if (splitted[0].equalsIgnoreCase("!removeplayernpcs")) {
for (ChannelServer channel : ChannelServer.getAllInstances()) {
for (MapleMapObject object : channel.getMapFactory().getMap(player.getMapId()).getMapObjectsInRange(new Point(0, 0), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.PLAYER_NPC))) {
MapleNPC pnpc = (MapleNPC) object;
if (pnpc.isCustom()) {
channel.getMapFactory().getMap(player.getMapId()).removeMapObject(object);
}
}
}
Connection con = DatabaseConnection.getConnection();
PreparedStatement ps = con.prepareStatement("DELETE FROM playernpcs WHERE map = ?");
ps.setInt(1, player.getMapId());
ps.executeUpdate();
ps.close();