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

Solved Segmentation fault (core dumped)

Discussion in 'Development' started by Slayer1K, May 28, 2020.

  1. Slayer1K

    Slayer1K Spider

    Messages:
    11
    GitHub:
    slayer1k
    When I try to start my server it shows this error.
    Code:
    [21:53:10] [Server thread/INFO]: Enabling SkyBlockCore v1
    
    Segmentation fault (core dumped)
    Coins.php (When i remove this file the plugin works again):
    Code:
    <?php
    
    namespace core\Coins;
    
    use core\Main;
    use pocketmine\command\Command;
    use pocketmine\command\CommandSender;
    
    class Coins extends Command {
        
        public $own;
        
        public function __construct() {
            self::__construct("/coins", "Coins command");
        }
        
        public function initialMoney(string $name) {
            $this->own->Coins->set($name, 0);
        }
        
        public function getMoney(string $name) {
            $coins = $this->own->Coins->get($name);
            return $coins;
        }
        
        public function execute(CommandSender $sender, string $commandLabel, array $args)
        {
            if(!isset($args[0])) {
                $coins = self::getMoney($sender->getName());
                $coinsA = preg_match_all( "/[0-9]/", $coins );
                $sender->sendMessage("Numeros de coins: " . $coinsA);
            }
        }
    
    }
     
  2. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    what is $own
     
  3. Slayer1K

    Slayer1K Spider

    Messages:
    11
    GitHub:
    slayer1k
    I used $own to access Main file but the error isnt related to that
     
  4. Slayer1K

    Slayer1K Spider

    Messages:
    11
    GitHub:
    slayer1k
    I already solved the issue but thx.
     
  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.