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

Execute command on event

Discussion in 'Facepalm' started by Zayd, Mar 19, 2017.

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

    Zayd Witch

    Messages:
    55
    GitHub:
    ZaydPE
    How would I execute a command (from console) on the end of a duel in minifixio's 1vs1? Where would I put the code aswell, like which file? Main?.
    I want the map to be reset so...
    PHP:
    public function onEndOfDuelEvent(){
        
    //code for executing the command, please tell me what it is?
     
  2. BouncyJeffer

    BouncyJeffer Spider Jockey

    Messages:
    39
    GitHub:
    bouncyjeffer
    Try this
    PHP:
    public function onEndOfDuelEvent(){
    $this->getServer()->dispatchCommand(new ConsoleCommandSender(), "say this is the command to be ran");
    }
     
    Last edited: Apr 16, 2017
  3. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    PHP:
    public function onEndOfDuelEvent(){
        
    Server::dispatchCommand(new ConsoleCommandSender(), "stop");
    }
     
Thread Status:
Not open for further replies.
  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.