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

setSkin In Linux OS

Discussion in 'Development' started by sdsd16, Mar 23, 2019.

  1. sdsd16

    sdsd16 Spider Jockey

    Messages:
    41
    GitHub:
    Danding1314
    [12:45:38] [Server thread/CRITICAL]: Error: "Call to undefined function SEXDCore\imagecreatefrompng()" (EXCEPTION) in "plugins/SEXDCore_SB/src/SEXDCore/Main" at line 679


    public function SetSkin($player, string $file, string $ex, string $geo){
    $skin = $player->getSkin();
    $path = $this->getDataFolder() . $file . $ex;
    $img = @imagecreatefrompng($path);
    $skinbytes = "";
    $s = (int) @getimagesize($path)[1];

    for($y = 0; $y < $s; $y++){
    for($x = 0; $x < 64; $x++){
    $colorat = @imagecolorat($img, $x, $y);
    $a = ((~((int)($colorat >> 24))) << 1) & 0xff;
    $r = ($colorat >> 16) & 0xff;
    $g = ($colorat >> 8) & 0xff;
    $b = $colorat & 0xff;
    $skinbytes .= chr($r) . chr($g) . chr($b) . chr($a);
    }
    }
    @imagedestroy($img);

    $player->setSkin(new Skin($skin->getSkinId(), $skinbytes, "", "geometry.rmsp" . $geo, file_get_contents($this->getDataFolder() . "geometry.json")));
    $player->sendSkin();

    }

    i copy the code in Dino this plugin :)
     
  2. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
  3. sdsd16

    sdsd16 Spider Jockey

    Messages:
    41
    GitHub:
    Danding1314
  4. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    Compile php-build-scripts with the -g flag to install the GD2 extension.
    Code:
    ./compile.sh -g
    
     
    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.