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

How to send a message to all operators?

Discussion in 'Development' started by AbelGamerC, Jan 27, 2018.

  1. AbelGamerC

    AbelGamerC Spider Jockey

    Messages:
    29
    GitHub:
    abelgamerc
    How to send a message to all operators? Help me plss is important
     
  2. Oniii-Chan

    Oniii-Chan Witch

    Messages:
    66
    GitHub:
    Vincent583
    if you want console send message to all op:
    foreach($this->getServer()->getOnlinePlayers as $player){
    if($player->isOp()){
    $server->sendMessage("Your message");
     
  3. Marabou

    Marabou Baby Zombie

    Messages:
    137
    GitHub:
    wiligangster
    WTF No. $player->sendMessage("...");
     
    Oniii-Chan likes this.
  4. Oniii-Chan

    Oniii-Chan Witch

    Messages:
    66
    GitHub:
    Vincent583
    I forgo x)
     
  5. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    PHP:
    /** @var Server $server */
    $server->broadcast("If you are reading this, you are an OP!"Server::BROADCAST_CHANNEL_ADMINISTRATIVE);
     
    Oniii-Chan, GamakCZ and SOFe 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.