Solved Error in PlaySoundPacket

Discussion in 'Development' started by BloodyJohnRus, Jan 4, 2022.

  1. BloodyJohnRus

    BloodyJohnRus Silverfish

    Messages:
    16
    GitHub:
    GDSHNIK
    Hello guys. What's wrong here?
    P.s. made this in tutorial at forum, also used protocol\PlaySoundPacket
    PHP:
        $pk=new PlaySoundPacket;
        
    $pk->soundName="challengesound";
        
    $pk->x=(int)$p->getX();
    $pk->y=(int)$p->getY();
        
    $pk->z=(int)$p->getZ();
        
    $pk->volume=1;
        
    $pk->pitch=1;
        
    $p->dataPacket($pk);
        }
    Console:
    Error: Undefined constant AP\new PlaySoundPacket
    2nd error after adding ::class:
    Assign property "soundName" on string
     
  2. BloodyJohnRus

    BloodyJohnRus Silverfish

    Messages:
    16
    GitHub:
    GDSHNIK
    Nvm, i fixed it
     

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.