Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How To Get Player Deaths??

Comments in 'Plugin Development' started by BeynerGames127, Jun 20, 2016.

  1. BeynerGames127
    Offline

    BeynerGames127 New Member

    Joined:
    Feb 24, 2016
    Posts:
    22
    Minecraft User:
    Beyner127
    Code:
    if (($mm = $pm->getPlugin("EconomyAPI")) !== null) {
        $vars["{Coins}"] = $mm->mymoney($player->getName());
    }
    if (($pp = $pp->getPlugin("PurePerms")) !== null) {
      $vars["{Rank}"] = $pp->getUser($player)->getGroup()->getName();
    }
    if  ? ? ? ?? ////HOW TO GET PLAYER DEATHS?////
    Can You Help Me Please??:(:confused:
    I Just Want To Use ["{Deaths}"] vars
    Last edited: Jun 20, 2016
  2. Extreme_Heat
    Offline

    Extreme_Heat Active Member

    Joined:
    Apr 19, 2016
    Posts:
    76
    Minecraft User:
    Extreme_Heat
    Player Deads...? What?
  3. BeynerGames127
    Offline

    BeynerGames127 New Member

    Joined:
    Feb 24, 2016
    Posts:
    22
    Minecraft User:
    Beyner127
    Keep track of deaths
  4. Extreme_Heat
    Offline

    Extreme_Heat Active Member

    Joined:
    Apr 19, 2016
    Posts:
    76
    Minecraft User:
    Extreme_Heat
    Code:
    using pocketmine\event\player\PlayerDeathEvent;
    
    public function onPlayerDeathEvent(PlayerDeathEvent $event) {
        $deaths[$event->getEntity()->getClientId()] = clone $event;
    }
    The above will store a PlayerDeathObject every time a player dies, if you want to just store the count then just make $deaths increment a number.
  5. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    Maybe you should learn PHP first.
    Or just ask someone to make the plugin for you.
  6. BeynerGames127
    Offline

    BeynerGames127 New Member

    Joined:
    Feb 24, 2016
    Posts:
    22
    Minecraft User:
    Beyner127
    Code:
    if (($kr = $pm->getPlugin("KillRate")) !== null) {
      $vars["{kills}"] = $kr->getKills($player);
    }
    why dont Work??:(
  7. Extreme_Heat
    Offline

    Extreme_Heat Active Member

    Joined:
    Apr 19, 2016
    Posts:
    76
    Minecraft User:
    Extreme_Heat
    Well why doesn't it work? What is that code supposed to do?
  8. Gamecrafter
    Offline

    Gamecrafter

    Joined:
    Nov 20, 2014
    Posts:
    978
    Plugins:
    9
    You'll need a counter. Increment the player's death count by one everytime they die. Have fun figuring that one out. :)
    It's use, not using. This is PHP, not C#. :p
    Extreme_Heat likes this.
  9. BeynerGames127
    Offline

    BeynerGames127 New Member

    Joined:
    Feb 24, 2016
    Posts:
    22
    Minecraft User:
    Beyner127
    trying to add it to Basic Hud

    XDDD:eek:):(:):(:):(:):(

Share This Page

Advertisement