Internal server error!

Discussion in 'Plugin Development' started by Rsdragonboy, May 1, 2012.

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

    Rsdragonboy

    Hello,
    I am working on a plugin right now but I have a little problem.


    Here is my code:

    Code:
        @EventHandler
        public void onPlayerJoin(PlayerJoinEvent event) {
            Player player = event.getPlayer();
            event.setJoinMessage(ChatColor.RED + "Welcome " + ChatColor.GOLD + player.getName() + ChatColor.RED);
            if (donator == 0) {
                Location loc = new Location(Bukkit.getWorld("lobby"), 256, 67, -313);
                player.teleport(loc);
            }
            if (donator == 1) {
                Location loc = new Location(Bukkit.getWorld("world"), -1576.5, 62, -610.5);
                player.teleport(loc);
            }
        }
    Kind regards,
    Rsdragonboy
     
  2. Offline

    ItsJerry

    Which one is line 103?
     
  3. Offline

    Rsdragonboy

    Okey I add the scheduler but now he won't teleport :s


    Code:
        @EventHandler
        public void onPlayerJoin(final PlayerJoinEvent event) {
            Player player = event.getPlayer();
            event.setJoinMessage(ChatColor.RED + "Welcome " + ChatColor.GOLD + player.getName() + ChatColor.RED + "");
            this.plugin.getServer().getScheduler().scheduleSyncDelayedTask(this.plugin,
                    new Runnable() {
                        public void run() {
                            Player player = event.getPlayer();
            if (donator == 0) {
                Location loc = new Location(Bukkit.getWorld("lobby"), 256, 67, -313);
                player.teleport(loc);
            }
            if (donator== 1) {
                Location loc = new Location(Bukkit.getWorld("world"), -1576.5, 62, -610.5);
                player.teleport(loc);
            }
              }
            }, 60L);
        }        
    When I login I got another error:

     
Thread Status:
Not open for further replies.

Share This Page