Hi ragezone
i'd like to make a npc to check if there is anyone on some map
i know hot to check on the map where the player is in but no on other map
please help :( :D
Printable View
Hi ragezone
i'd like to make a npc to check if there is anyone on some map
i know hot to check on the map where the player is in but no on other map
please help :( :D
Just modify the variable at the top where I commented. And if you don't have the method cm.getPlayerCount(mapid), place this in your AbstractPlayerInteraction.java filePHP Code:/*
-----------------------------
Created by Ryuuzi
-----------------------------
Map Player Checker
-----------------------------
Maplestory v.83
-----------------------------
*/
var status;
var chosenSel;
var mapSelections = [/*Enter list of Map ID's you want to check here*/];
function start() {
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1) {
cm.dispose();
return;
} else {
if (mode == 1) {
status++;
} else {
status--;
}
}
if (status == 0) {
cm.sendNext("Hello, let me check to see what maps are available to warp to.");
} else if (status == 1) {
if (mode == 0) {
cm.sendOk("Alright then, I'll see you around.");
cm.dispose();
} else {
var text = "These are the maps that are currently available to warp to: \r\n#b";
for (var i = 0; i < mapSelections.length; i++) {
if (cm.getPlayerCount(mapSelections[i]) > 1) {
continue;
} else {
text += "\r\n#L" + i + "##m" + mapSelections[i] + "##l";
}
}
cm.sendSimple(text);
}
} else if (status == 2) {
chosenSel = selection;
cm.sendYesNo("Are you sure you'd like to go to #b#m" + mapSelections[selection] + "##k?");
} else if (status == 3) {
cm.warp(mapSelections[chosenSel]);
cm.dispose();
}
}
(Taken from MoopleDEV rev.115)PHP Code:public int getPlayerCount(int mapid) {
return c.getChannelServer().getMapFactory().getMap(mapid).getCharacters().size();
}
If you're talking about the getPlayerCount method, yes. Just place it in the AbstractPlayerInteraction.java file and it should still work.