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

commands

Discussion in 'Development' started by DogTheBlock, May 28, 2017.

  1. DogTheBlock

    DogTheBlock Spider Jockey

    Messages:
    29
    how can i run a other command using codes?
    PHP:
            $this->getServer()->dispatchCommand(new ConsoleCommandSender(), "say hello");
     
  2. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
    What??? other commands?
    PHP:
    $this->getServer()->dispatchCommand(new ConsoleCommandSender(), "YOUR COMMAND HERE");
    Or you mean run commands as player?
    PHP:
    /** var Player $p */
    $this->getServer()->dispatchCommand($p"YOUR COMMAND HERE");
     
  3. DogTheBlock

    DogTheBlock Spider Jockey

    Messages:
    29
    i can't run the command as a player because the player doesn't have perm for the command i want it to use
     
  4. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
    Add perm to player or remove perm from command
     
  5. DogTheBlock

    DogTheBlock Spider Jockey

    Messages:
    29
    PHP:
            $cmd "setuperm " $pn " vortex.command.fly";
            
    $this->getServer()->dispatchCommand(new ConsoleCommandSender(), $cmd);
    would this work?
     
  6. DogTheBlock

    DogTheBlock Spider Jockey

    Messages:
    29
    sorry ,
    PHP:
    $pn $player->getName();
    $player $event->getPlayer();
     
  7. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    Adding the permission depends on your Permission Management plugin
     
    Muqsit likes this.
  8. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    jasonwynn10 likes 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.