Skip to content

Commit

Permalink
Home for other added.
Browse files Browse the repository at this point in the history
Signed-off-by: Joscha1234 <[email protected]>
  • Loading branch information
Joscha1234 committed May 2, 2013
1 parent 0223277 commit 7212ba1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
16 changes: 9 additions & 7 deletions src/com/dre/managerxl/commands/player/Home.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,17 @@ public void onExecute(String[] args, CommandSender sender) {
P.p.msg(player, P.p.getLanguageReader().get("Error_CmdHome_NoHome"));
}
} else {
MPlayer oPlayer = MPlayer.get(args[0]);
if (oPlayer != null){
if (oPlayer.getHome() != null){
player.teleport(oPlayer.getHome());
if (P.p.getPermissionHandler().has(sender, "mxl.cmd.player.homeother")){
MPlayer oPlayer = MPlayer.get(args[0]);
if (oPlayer != null){
if (oPlayer.getHome() != null){
player.teleport(oPlayer.getHome());
} else {
P.p.msg(player, P.p.getLanguageReader().get("Error_CmdHome_NoHome2", args[0]));
}
} else {
P.p.msg(player, P.p.getLanguageReader().get("Error_CmdHome_NoHome2", args[0]));
P.p.msg(player, P.p.getLanguageReader().get("Error_PlayerNotExist", args[0]));
}
} else {
P.p.msg(player, P.p.getLanguageReader().get("Error_PlayerNotExist", args[0]));
}
}
}
Expand Down
16 changes: 14 additions & 2 deletions src/com/dre/managerxl/commands/player/SetHome.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,20 @@ public void onExecute(String[] args, CommandSender sender) {
Player player = (Player) sender;
MPlayer mPlayer = MPlayer.getOrCreate(sender.getName());

mPlayer.setHome(player.getLocation());
P.p.msg(player, P.p.getLanguageReader().get("Cmd_SetHome_Success"));
if(args.length < 1){
mPlayer.setHome(player.getLocation());
P.p.msg(player, P.p.getLanguageReader().get("Cmd_SetHome_Success"));
}else{
if (P.p.getPermissionHandler().has(sender, "mxl.cmd.player.sethomeother")){
MPlayer oPlayer = MPlayer.get(args[0]);
if (oPlayer != null){
oPlayer.setHome(player.getLocation());
P.p.msg(player, P.p.getLanguageReader().get("Cmd_SetHome_Success"));
} else {
P.p.msg(player, P.p.getLanguageReader().get("Error_PlayerNotExist", args[0]));
}
}
}

This comment has been minimized.

Copy link
@Grafe

Grafe May 2, 2013

Member

@Joscha1234 sauber!

}

}

0 comments on commit 7212ba1

Please sign in to comment.