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

SetDifficultyPacket

Discussion in 'Development' started by Daniel23, Nov 14, 2017.

  1. Daniel23

    Daniel23 Witch

    Messages:
    65
    GitHub:
    daniel23
    Giving this issue when pvp

    The Code:
    PHP:
    public function DisablePvP(Player $player){
      
    $plugin $this->plugin;
      
    $plugin->getServer()->setConfigInt("difficulty"0);
      
    $pk = new SetDifficultyPacket();
      
    $pk->difficulty $plugin->getServer()->getDifficulty();
      
    $player->dataPacket($pk);
         }
    Code:
      if($args[0] == "on"){
      $this->ActivatePvP();
      $pl->sendMessage(T::BLUE."PvP Activated");
      }else if($args[0] == "off"){
      $this->DisablePvP();
      $pl->sendMessage(T::RED."PvP Deactivated");
     
  2. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    What do you see that's wrong with calling the function?
    PHP:
    public function DisablePvP(Player $player){
    Code:
    $this->DisablePvP();
     
    Kyd and HimbeersaftLP like 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.