Need help with commands and setLobbySpawns?

Discussion in 'Plugin Development' started by jusjus112, Jan 10, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    jusjus112

    I have an minigame plugin, now i have an question.
    how do i set the lobbyspawn point? Ive tried:

    in my ArenaManager class:
    Code:java
    1. public void setArenaLobby(Player sender, int i) {
    2. Arena a = getArena(i);
    3. if(a == null) {
    4. sender.sendMessage(MsgType.NORMAL + "Arena " + ChatColor.YELLOW + i + ChatColor.GREEN + " is not found");
    5. return;
    6. }
    7. a.setLobyPoint(sender.getLocation(), i);
    8. }

    And my Arena class:
    Code:java
    1. public Location lobbyloc = null;
    2.  
    3. public void setLobyPoint(Location lobbyloc, int i) {
    4. this.lobbyloc = lobbyloc;
    5. this.id = i;
    6. }
    7.  
    8. public Location getLobbyLocation() {
    9. return this.lobbyloc;
    10. }


    but with my comment, i need help, with the command arguments.
    I have so far:
    Code:java
    1. f (args.length == 3) {
    2. if (args[0].equalsIgnoreCase("editarena")) {
    3. if (!p.hasPermission("gm.edit")) {
    4. p.sendMessage(MsgType.DENIED + "You dont have permissions!");
    5. return true;
    6. }
    7. if (args.length == 3) {
    8. if (args[1].equalsIgnoreCase("lobby")) {
    9. int num = 0;
    10. try{
    11. num = Integer.parseInt(args[3]);
    12. p.sendMessage(MsgType.ERROR + "Invalid arena ID " + args[3]);
    13. }
    14. ArenaManager.getManager().setArenaLobby(p, num);
    15. }
    16. }
    17. }
    18. }

    but id dont work if itype /gun editarena lobby 1
    Anyone help?
     
  2. Offline

    xTrollxDudex

Thread Status:
Not open for further replies.

Share This Page