Addon to server side map icon
You need to have done [Only registered and activated users can see links. Click Here To Register...] first, or else it will not work
Add this command
Code:
if (command.startsWith("markmap") && playerRights > 1) {
String sub[] = command.split(" ");
BufferedWriter bw = null;
try {
bw = new BufferedWriter(new FileWriter("mapicons.cfg", true));
bw.write("map = "+sub[1]+" "+absX+" "+absY);
bw.newLine();
bw.flush();
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (bw != null)
try {
bw.close();
} catch (IOException ioe2) {
sendMessage("Error writing mapicon");
}
}
markminimap(sub[1], absX, absY);
}
then add this
Code:
public boolean maps() {
String line = "";
String token = "";
String token2 = "";
String token2_2 = "";
String[] token3 = new String[10];
boolean EndOfFile = false;
int ReadMode = 0;
BufferedReader mapicons = null;
try {
mapicons = new BufferedReader(new FileReader("./mapicons.cfg"));
} catch(FileNotFoundException fileex) {
misc.println("mapicons.cfg: file not found.");
return false;
}
try {
line = mapicons.readLine();
} catch(IOException ioexception) {
misc.println("mapicons.cfg: error loading file.");
return false;
}
while(EndOfFile == false && line != null) {
line = line.trim();
int spot = line.indexOf("=");
if (spot > -1) {
token = line.substring(0, spot);
token = token.trim();
token2 = line.substring(spot + 1);
token2 = token2.trim();
token2_2 = token2.replaceAll("\t\t", "\t");
token2_2 = token2_2.replaceAll("\t\t", "\t");
token2_2 = token2_2.replaceAll("\t\t", "\t");
token2_2 = token2_2.replaceAll("\t\t", "\t");
token2_2 = token2_2.replaceAll("\t\t", "\t");
token3 = token2_2.split("\t");
markminimap(token3[0], Integer.parseInt(token3[1]), Integer.parseInt(token3[2]));
}
try {
line = mapicons.readLine();
} catch(IOException ioexception1) { EndOfFile = true; }
}
try { mapicons.close(); } catch(IOException ioexception) { }
return false;
}
then in case 121, add this
Then make a new file named mapicons.cfg, compile and run!
to use the command, type ::markmap [Only registered and activated users can see links. Click Here To Register...] (just an example.
credits to this addon:
100% me for the addon (i made the addon 100% myself), and credits from the origional post