hello!
There's a glitch i noticed with the commnand !tag/!killnear. When I jump down off a platform and use !tag, it kills almost everyone in the map. How do I prevent that from happening? I only want the command to kill players near me. If anyone can help me, that would be great. Thanks!
Here's the command:
There's a glitch i noticed with the commnand !tag/!killnear. When I jump down off a platform and use !tag, it kills almost everyone in the map. How do I prevent that from happening? I only want the command to kill players near me. If anyone can help me, that would be great. Thanks!
Here's the command:
Code:
public static class TAG extends CommandExecute {
@Override
public int execute(MapleClient c, String[] splitted) {
MapleMap map = c.getPlayer().getMap();
List<MapleMapObject> players = map.getMapObjectsInRange(c.getPlayer().getPosition(), (double) 43000, Arrays.asList(MapleMapObjectType.PLAYER));
for (MapleMapObject closeplayers : players) {
MapleCharacter playernear = (MapleCharacter) closeplayers;
if (playernear.isAlive() && playernear != c.getPlayer() && !playernear.isGM()) {
if (playernear.isAlive() && playernear != c.getPlayer() && !playernear.isGM()) {
playernear.updateSingleStat(MapleStat.HP, 0);
playernear.dropMessage(5, "You have been tagged by " + c.getPlayer().getName() +".");
}
}
}
return 1;
}
}