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

[New API] Problem getting total players in world

Comments in 'Plugin Development' started by EvolSoft, Oct 12, 2014.

  1. EvolSoft
    Offline

    EvolSoft Notable Member Plugin Developer

    Joined:
    Sep 10, 2014
    Posts:
    821
    Plugins:
    15
    Minecraft User:
    Flavius12
    I have a stange problem getting the number of online players in world. This is my code:
    PHP:
    $player->sendMessage("Players in world" count($sender->getLevel()->getPlayers()));
    The code works but i get this thing in PocketMine console: "[NOTICE] An E_NOTICE error happened: "Undefined offset: 1 in...".
    What did I do wrong?
    Last edited: Oct 13, 2014
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Undefined offset in what? That's critical...
    LDX likes this.

Share This Page

Advertisement