1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Kick on deathevent ?

Discussion in 'Development' started by CupidonSauce173, Apr 2, 2019.

  1. CupidonSauce173

    CupidonSauce173 Zombie

    Messages:
    298
    GitHub:
    cupidonsauce173
    $player->kick()

    I've had some issues with that. I still don't know if it's pmmp or not

    Without plugins I get an error about droppingxp on null and when there is a world management plugin, itd about game rules

    Is there a way to kick a player on deathevent without ->kick()?
     
  2. dktapps

    dktapps Administrator Staff Member PMMP Team

    Messages:
    774
    GitHub:
    dktapps
    CupidonSauce173 likes this.
  3. CupidonSauce173

    CupidonSauce173 Zombie

    Messages:
    298
    GitHub:
    cupidonsauce173
    Oh ok, I will use make a life system then. Thanks for the fast reply
     
  4. KielKing

    KielKing Zombie

    Messages:
    245
    GitHub:
    kielking
    i'm not sure but I think the event will do actions with the player in the next tick, so you need to kick the player in the next tick, you can schedule a delayed task and use a ClosureTask class
     
  5. CupidonSauce173

    CupidonSauce173 Zombie

    Messages:
    298
    GitHub:
    cupidonsauce173
    Okok
     
  6. Levi

    Levi Skeleton

    Messages:
    955
    GitHub:
    captainleviftw
    Is $player->close() any different?
     
  7. CupidonSauce173

    CupidonSauce173 Zombie

    Messages:
    298
    GitHub:
    cupidonsauce173
    No, but I found a hacky solution, I moved the kick on respawn event...Ik I shouldn't but it will be like that until 4.0.0 and anyway, I get no error anymore
     
  8. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Never use $player->close() whatsoever it's an internal method.
     
    SleepSpace9 and CupidonSauce173 like this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.