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

Error plugin.

Comments in 'Plugin Development' started by xpyctum, Jan 13, 2014.

  1. xpyctum
    Offline

    xpyctum Active Member Plugin Developer

    Joined:
    Jan 13, 2014
    Posts:
    292
    Plugins:
    4
    Minecraft User:
    tylerdisney
    Please help me :( I Have a Error, and i don't know where it. Please, help and read more, because it is my first redesigned plugin. I'm from Russia, and ignore errors :)
    PHP:
    <?php

    /*
    __PocketMine Plugin__
    name=SignPro
    description= Live Signs at its best!
    version=1.0
    author=NIM
    class=Sign
    apiversion=11
    */

    class Sign implements Plugin{
        private 
    $api$server;
        public function 
    __construct(ServerAPI $api$server false){
            
    $this->api $api;
            
    $this->server ServerAPI::request();
        }

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

        public function 
    eventHandler($data$event){
            switch (
    $event) {
                case 
    "tile.update":
                    if (
    $data->class === TILE_SIGN) {
                        if(
    $data->data["Monitor"] == "MONITOR" or $data->data["Монитор"] == "MONITOR"){
                      return;
                        
    $data->setText(".count($this->api->player->getAll())."/".$this->server->maxClients)).""MONITOR""PLAYERS");
                        break;
                       
                        }
                      public function 
    __destruct(){
        }
    }
  2. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,429
    Plugins:
    14
    That's not your plugin.
    Darunia18 likes this.
  3. xpyctum
    Offline

    xpyctum Active Member Plugin Developer

    Joined:
    Jan 13, 2014
    Posts:
    292
    Plugins:
    4
    Minecraft User:
    tylerdisney
    I say: redesigned! Please..
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
  5. xpyctum
    Offline

    xpyctum Active Member Plugin Developer

    Joined:
    Jan 13, 2014
    Posts:
    292
    Plugins:
    4
    Minecraft User:
    tylerdisney
    It is could it be? it?
    Code:
     public function setText($line1 = "", $line2 = "", $line3 = "", $line4 = ""){
                    if($this->class !== TILE_SIGN){
                            return false;
                    }
                    $this->data["Text1"] = $line1;
                    $this->data["Text2"] = $line2;
                    $this->data["Text3"] = $line3;
                    $this->data["Text4"] = $line4;
                    $this->server->api->tile->spawnToAll($this);       
                    $this->server->handle("tile.update", $this);
                    return true;
            }
    It is this code? I am noob :(
  6. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Yes.
    First, what did you want to do in the first place?
    Second, you should only call the public function setText() and not anything else to change a sign's text.
  7. xpyctum
    Offline

    xpyctum Active Member Plugin Developer

    Joined:
    Jan 13, 2014
    Posts:
    292
    Plugins:
    4
    Minecraft User:
    tylerdisney
    I want that when you click that it was written in the chat. Sorry, i'm use translate, because don't know in English someone words
  8. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    You mean you want to send a sign's text to the player by chat?

    Refer to SignConsole.
  9. xpyctum
    Offline

    xpyctum Active Member Plugin Developer

    Joined:
    Jan 13, 2014
    Posts:
    292
    Plugins:
    4
    Minecraft User:
    tylerdisney
    No, I want a: if player touch a sign, chat sent to player personal sms.
  10. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    What is personal sms?
  11. xpyctum
    Offline

    xpyctum Active Member Plugin Developer

    Joined:
    Jan 13, 2014
    Posts:
    292
    Plugins:
    4
    Minecraft User:
    tylerdisney
    to only the player went SMS

Share This Page

Advertisement