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

How to Get Player in Task File

Discussion in 'Development' started by byyEmirhanWSD, Mar 18, 2018.

  1. byyEmirhanWSD

    byyEmirhanWSD Witch

    Messages:
    50
    GitHub:
    EmirhanWSD
    Hey guys. Please help me. I want Get Player in Task File.
    PHP:
    // Task
    private $o;
    private 
    $p;

    public function 
    __construct(Main $pPlayer $o) {
      
    $this->$p;
      
    $this->$o;
      
    parent::__construct($p);

    }

    // Main
    public $o;
    $this->getServer()->getScheduler()->scheduleRepeatingTask(new Gun($thisPlayer $this->o), 20);
     
  2. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    well you did passed player so i dont get what you are missing
     
    iiFlamiinBlaze likes this.
  3. Daniktheboss

    Daniktheboss Baby Zombie

    Messages:
    144
    GitHub:
    daniktheboss
    That get ALL players online...
     
  4. Daniktheboss

    Daniktheboss Baby Zombie

    Messages:
    144
    GitHub:
    daniktheboss
    Why not pass object already?
     
  5. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
    Use getPlayerExact() to find player by exact name
     
  6. Daniktheboss

    Daniktheboss Baby Zombie

    Messages:
    144
    GitHub:
    daniktheboss
    if($player->getName() == $player->getName())
     
  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.