why crash by command?

Discussion in 'Development' started by Hoyee, Mar 11, 2020.

  1. Hoyee

    Hoyee Slime

    Messages:
    90
    PHP:
    $a=array("a","b""c");
    if ((
    $command==$a[0] [2]) && ($player->isOp())){
            
    $ap->setImmoblie(true);
            
    $this->getServer()->broadCastMessage($tag.  stop ");
          }

          if ((
    $command==$a[0] [1]) && ($player->isOp()) && ($ap->isImmobile())){
            
    $ap->setCanclled();
            
    $this->getServer()->broadCastMessage($tag. "move");
          }
    commands:
    a b:
    description: move
    a c:
    description: stop

    it says "Uninitialized string offset: 2" (EXCEPTION)
     
  2. Muqsit

    Muqsit Chicken

    Messages:
    1,572
    GitHub:
    muqsit
    What do you expect $a[0][2] and $a[0][1] to return?
     
    HimbeersaftLP likes this.

Share This Page

  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.