[Release]Close / Open all portals on map
I know this is not so good since you cant close a specific portal o0.
This just closes all the portals on the map.
!closeportal
Code:
} else if (splitted[0].equalsIgnoreCase("!closeportal")) {
int mapid = Integer.parseInt(splitted[1]);
player.getClient().getChannelServer().getMapFactory().getMap(mapid).getPortal("sp").setPortalState(MaplePortal.CLOSE);
!openportal
Code:
} else if (splitted[0].equalsIgnoreCase("!openportal")) {
int mapid = Integer.parseInt(splitted[1]);
player.getClient().getChannelServer().getMapFactory().getMap(mapid).getPortal("sp").setPortalState(MaplePortal.OPEN);
For the imports : Ctrl + Shift + I
Re: [Release]Close / Open all portals on map
Re: [Release]Close / Open all portals on map
shouldn't need any imports iirc
Re: [Release]Close / Open all portals on map
question : i can use it to close specific portal? i mean, if i'm launching GMS-like server, and i want only FM 1 and 2 will be open, i can run a diffrent command to each other portal in FM to close them, just need to change this :
PHP Code:
} else if (splitted[0].equalsIgnoreCase("!openportal")) {
int mapid = Integer.parseInt(splitted[1]);
player.getClient().getChannelServer().getMapFactory().getMap(mapid).getPortal("[B]sp[/B]").setPortalState(MaplePortal.OPEN);
to the portal name (where i bold it)?
Re: [Release]Close / Open all portals on map
Quote:
Originally Posted by
Shogi
question : i can use it to close specific portal? i mean, if i'm launching GMS-like server, and i want only FM 1 and 2 will be open, i can run a diffrent command to each other portal in FM to close them, just need to change this :
PHP Code:
} else if (splitted[0].equalsIgnoreCase("!openportal")) {
int mapid = Integer.parseInt(splitted[1]);
player.getClient().getChannelServer().getMapFactory().getMap(mapid).getPortal("[B]sp[/B]").setPortalState(MaplePortal.OPEN);
to the portal name (where i bold it)?
Block it from the XML
Re: [Release]Close / Open all portals on map
would this get back to normal after server restart >.>
Re: [Release]Close / Open all portals on map
Quote:
Originally Posted by
ScalloT
would this get back to normal after server restart >.>
Yes it would
Re: [Release]Close / Open all portals on map
Here you go god this is what you are looking for.
PHP Code:
} else if(splitted[0].equals("!openPortal")) {
if (splitted.length != 2) {
mc.dropMessage("Syntax: !openPortal <name>, where name is the portal name");
} else {
player.getMap().getPortal(splitted[1]).setPortalState(true);
}
Re: [Release]Close / Open all portals on map
Pro idea: Make it so that you can close portals on a specific map.
Re: [Release]Close / Open all portals on map
Use my Command and base it off for ClosePortal. Common Sense.
Re: [Release]Close / Open all portals on map
Quote:
Originally Posted by
gmsinister
Use my Command and base it off for ClosePortal. Common Sense.
What are you talking about? :)
Re: [Release]Close / Open all portals on map
The command i posted use it for it to be able to close Portals. also pro tip: True Vise versa False.
Re: [Release]Close / Open all portals on map
Quote:
Originally Posted by
gmsinister
The command i posted use it for it to be able to close Portals. also pro tip: True Vise versa False.
Oh, you think I wanted to use this thing? :( I was just offering a suggestion.
Re: [Release]Close / Open all portals on map
O i see well then anyway thats all folks.
Re: [Release]Close / Open all portals on map
Code:
if(splitted[0].equals("!portal")) {
int mapID = Integer.parseInt(splitted[1]);
String status = splitted[2].toLowerCase();
String portalName = splitted[3];
if (splitted.length != 3) {
player.getMap().getPortal(splitted[3]).setPortalState(true);
if (status.equalsIgnoreCase("open")) {
map.getMap(mapID).getPortal(portalName).setPortalState(true);
}
if (status.equalsIgnoreCase("close")) {
map.getMap(mapID).getPortal(portalName).setPortalState(false);
}
} else {
player.dropMessage(5, "Incorrect Syntax. Correct: !portal <mapID> <open/close> <portalName>");
}
}
???
Code:
public static MapleMapFactory map;