Solved Kamikaze. How to check ?

Discussion in 'Plugin Development' started by Tomass, Sep 3, 2014.

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

    Tomass

    Hello guys,

    I create a Kamikaze class for players, and now I only set explosion without block damage and fire, but I want, that if other players die of this explosion, "kamikaze" will get points.

    I have only one idea, but very buggy: check kamikaze and give for the global varriable this player (like: kamikaze = e.getPlayer();) and then check death cause, if the reason of death is explosion then give points for kamikaze.

    Thanks!

    P.S Sorry for my bad english :(
     
  2. Offline

    TheMcScavenger

    • Create the explosion
    • Set a variable to true
    • Create a delayed task for +- 2 seconds
    • Set the variable to false
    If a player dies due to an explosion, and the variable is true, it's because of your explosion.

    EDIT: In case you're really worried about the possibility that this'll get a false response (seeing as people can theoretically die of explosions not caused by you, store and check the location.
     
  3. Offline

    Anrza

    Do what previous poster said or something like this:
    Check if they died near the explosion, by an explosion and the same second as the explosion.
     
Thread Status:
Not open for further replies.

Share This Page