Add if statements to the command?
|
Hi, I need to make it so my ::home won't tele people out of fight caves and wildy.
I don't know what to add is what im trying to get to
add this statement to your teleports:
if (!player.canSpawn()) {
player.getPackets().sendGameMessage(
"You can't teleport at this area.");
return true;
Can you give me the whole command as mine doesn't work when putting that in
Bump
It would be something like this, I don't know what source you're using:
Code:if(command.equals("home") { if(player.inWild() && player.wildLevel >= 20) { player.sendMessage("You cannot teleport above level 20 wilderness!"); return; } if(player.inFightCaves()) { player.sendMessage("You cannot teleport from the fight caves!"); return; } player.getLocation().teleport(Settings.HOME_X, Settings.HOME_Y, Settings.HOME_Z); }
I can guarantee you that won't work for your source, whatever it is. It's your job to figure out which methods and classes to use and import.
... thanks but if u know its not going to work then... anyone else
Oh god.
what?
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |