Function not working

Discussion in 'Plugin Development' started by eagledude4, Feb 5, 2011.

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

    eagledude4

    Please remove
     
  2. Offline

    Crash

    onPlayerJoin has PlayerEvent as a param not PlayerLoginEvent.

    I'm pretty sure this would be your problem.
     
  3. Offline

    eagledude4

    Okay so how do I set the spawn after somebody dies, not just when they first join the server?
     
  4. Offline

    robhol

    Keep a HashMap<Player,bool> and set it to false when joining and true when dying. Then you can check it whenever. (Assuming there's no data in the event to tell you, I honestly don't know.)
     
  5. Offline

    eagledude4

    Will a seperate method work too? Unfortunately this doesn't work tho:

    Code:
    public void onPlayerDeath(PlayerEvent e) {
        Player player = e.getPlayer();
        //users
        double uX = -903.4378328594687;
        double uY = -903.4378328594687;
        double uZ = -214.5814831264097;
        float uPitch = 8.100071907043457f;
        float uYaw = -358.3551940917969f;
        Location userSpawn = new Location(player.getWorld(), uX, uY, uZ, uPitch, uYaw);
        //ops
        double oX = -903.4378328594687;
        double oY = -903.4378328594687;
        double oZ = -214.5814831264097;
        float oPitch = 8.100071907043457f;
        float oYaw = -358.3551940917969f;
        Location opSpawn = new Location(player.getWorld(), oX, oY, oZ, oPitch, oYaw);
            if (player.getHealth() == 0) {
                e.getPlayer().sendMessage("You did died :(");
                if (e.getPlayer().isOp()) {
                    e.getPlayer().teleportTo(opSpawn);
                } else {
                    e.getPlayer().teleportTo(userSpawn);
                }
            }
        }
    }
    --- merged: Feb 6, 2011 12:05 AM ---
    Never mind, I found that its easier to just set a spawn in the user area and teleport to the op area
     
Thread Status:
Not open for further replies.

Share This Page