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

why crash by command?

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

  1. Hoyee

    Hoyee Baby Zombie

    Messages:
    126
    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,548
    GitHub:
    muqsit
    What do you expect $a[0][2] and $a[0][1] to return?
     
    HimbeersaftLP 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.