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

Multiple commands

Discussion in 'Development' started by Trxgically, Feb 24, 2019.

  1. Trxgically

    Trxgically Spider Jockey

    Messages:
    26
    GitHub:
    trxgically
  2. Diduhless

    Diduhless Baby Zombie

    Messages:
    199
    GitHub:
    Diduhless
    Can you explain better? I don't find /sc spawn in the class you've sent.
     
  3. Trxgically

    Trxgically Spider Jockey

    Messages:
    26
    GitHub:
    trxgically
    PHP:
    case "spawn":
            if (
    $this->config->getNested("set.spawn") === false)
             {
             
    $sender->sendMessage($color5 "[" $color2 "SC" $color5 "]" TF::RESET " There is no current spawn set!");
             }
            elseif (
    $this->config->getNested("set.spawn") === true)
             {
             
    $sender->sendMessage($color5 "[" $color2 "SC" $color5 "]" TF::RESET " Teleporting to spawn...");
             
    $x $this->config->getNested("sspawn-point.x");
             
    $y $this->config->getNested("sspawn-point.y");
             
    $z $this->config->getNested("sspawn-point.z");
             
    $position = new Position($x$y$z);
             
    $sender->teleport($position);
             }
            break;
    It is at line 116
     
  4. Diduhless

    Diduhless Baby Zombie

    Messages:
    199
    GitHub:
    Diduhless
    PHP:
    if($command->getName() === "spawn") { }
     
  5. Trxgically

    Trxgically Spider Jockey

    Messages:
    26
    GitHub:
    trxgically
    I’m not that retarded, I tried that and it didn’t work let me try to get the error.
     
  6. Diduhless

    Diduhless Baby Zombie

    Messages:
    199
    GitHub:
    Diduhless
    Well that's the solution if you don't know where to put an if statement it's not my fault
     
  7. Ameer4Real

    Ameer4Real Creeper

    Messages:
    5
    GitHub:
    ameer4real
  8. Diduhless

    Diduhless Baby Zombie

    Messages:
    199
    GitHub:
    Diduhless
    jasonwynn10 and EdwardHamHam like this.
  9. Trxgically

    Trxgically Spider Jockey

    Messages:
    26
    GitHub:
    trxgically
    As said above, I didn’t ask for a plugin. If you would have read the thread you would have seen I am creating a plugin.
     
    jasonwynn10 likes this.
  10. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    Well, you already have written the code to do that actually...
    PHP:
    //onCommand
    switch ($command->getName()) {
        case 
    "spawn":
            
    //...
            
    break;
    }
    Either you already found the solution or you're experiencing problems with registering the command.
     
  11. Trxgically

    Trxgically Spider Jockey

    Messages:
    26
    GitHub:
    trxgically
    I already found a solution thanks! ;)
     
  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.