Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Outdated SignPortal 0.1

Tap sign to teleport

  1. wrewolf
    Offline

    wrewolf New Member Plugin Developer

    Joined:
    Nov 9, 2013
    Posts:
    45
    Plugins:
    4
    Minecraft User:
    isprion
    wrewolf submitted a new plugin:

    SignPortal - Tap sign to teleport

    Read more about this plugin...
  2. alkurian
    Offline

    alkurian New Member

    Joined:
    Oct 15, 2013
    Posts:
    21
    Minecraft User:
    LaVerge
    hows locations coming?
  3. Xenon_TNT
    Offline

    Xenon_TNT New Member

    Joined:
    Jan 26, 2014
    Posts:
    8
    Minecraft User:
    Xenon_TNT
    Very nice plugin but I am facing one problem when players are in different world and tap signs to come back to main world server crash any fix for it?
  4. xpyctum
    Offline

    xpyctum Active Member Plugin Developer

    Joined:
    Jan 13, 2014
    Posts:
    292
    Plugins:
    4
    Minecraft User:
    tylerdisney
    It is a bug from game.
  5. xpyctum
    Offline

    xpyctum Active Member Plugin Developer

    Joined:
    Jan 13, 2014
    Posts:
    292
    Plugins:
    4
    Minecraft User:
    tylerdisney
    Last edited: Feb 7, 2014
  6. xpyctum
    Offline

    xpyctum Active Member Plugin Developer

    Joined:
    Jan 13, 2014
    Posts:
    292
    Plugins:
    4
    Minecraft User:
    tylerdisney
    Unlimited
  7. Butter137
    Offline

    Butter137 New Member

    Joined:
    Oct 25, 2013
    Posts:
    2
    Minecraft User:
    Butter137
    How do i download this plugin
  8. NIM
    Offline

    NIM Active Member

    Joined:
    Nov 28, 2013
    Posts:
    74
    Minecraft User:
    NIMGamingPRO
    Click "Download Plugin"
  9. Butter137
    Offline

    Butter137 New Member

    Joined:
    Oct 25, 2013
    Posts:
    2
    Minecraft User:
    Butter137
    When i do it says

    <?php

    /*
    __PocketMine Plugin__
    name=Portal
    description=
    version=0.1
    author=WreWolf
    class=PortalW
    apiversion=9,10
    */


    class PortalW implements Plugin
    {
    private $api;

    public function __construct(ServerAPI $api, $server = false)
    {
    $this->api = $api;
    }

    public function init()
    {
    $this->api->addHandler("tile.update", array($this, "eventHandler"));
    $this->api->addHandler("player.block.touch", array($this, "eventHandler"));
    }

    public function __destruct()
    {

    }

    public function handle($data, $event)
    {

    }

    public function eventHandler(&$data, $event)
    {
    switch ($event) {
    case "tile.update":
    if ($data->class === TILE_SIGN) {
    if ($data->data["Text1"] != "w:" and $data->data["Text3"] != "tp")
    return;
    $lvl = $data->data["Text2"];
    if ($this->api->level->loadLevel($lvl) === false) {
    $this->api->chat->sendTo(false, "Mir $lvl ne sushestvuet", $data->data['creator']);
    break;
    }
    $this->api->chat->broadcast("Portal to " . $data->data["Text1"] . $data->data["Text2"] . " created");
    }
    break;
    case "player.block.touch":
    $tile = $this->api->tile->get(new Position($data['target']->x, $data['target']->y, $data['target']->z, $data['target']->level));
    if ($tile === false) break;
    $class = $tile->class;
    switch ($class) {
    case TILE_SIGN:
    switch ($data['type']) {
    case "place":
    console("touch sign place " . $tile->data['Text1'] . $tile->data['Text2']);
    if ($tile->data['Text1'] == "w:" and $tile->data['Text3'] == "tp") {
    $mapname = $tile->data['Text2'];
    $lvlname = $tile->data['Text1'] . $mapname;
    $username=$data['player']->username;
    console("teleport('$lvlname', $username)");
    $this->api->level->loadLevel($mapname);
    $this->api->player->teleport($username,$lvlname);
    }
    break;
    }
    break;
    }
    break;
    }

    }

    function debug_print($str)
    {
    console($str);
    }
    }

Share This Page

Advertisement