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

Call to undefined method HG\Main::sendTip()

Comments in 'Plugin Development' started by TryoneLegendZzz, Jun 5, 2015.

  1. TryoneLegendZzz
    Offline

    TryoneLegendZzz Active Member

    Joined:
    May 31, 2015
    Posts:
    201
    Minecraft User:
    SavionLegendZzz
    i dont know what to do it only works with sendMessage() and broadcastMessage()
    Screenshot_28.png
  2. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    You can only send a Tip to a player. Also it is an event, use
    PHP:
    public function onJoin(PlayerJoinEvent $event){
    $player $event->getPlayer();
    $player->sendTip("Your-Tip");
    }
    Of course you have to use/import PlayerJoinEvent.
  3. TryoneLegendZzz
    Offline

    TryoneLegendZzz Active Member

    Joined:
    May 31, 2015
    Posts:
    201
    Minecraft User:
    SavionLegendZzz
    but its a CallBackTaskk
  4. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Where is it a CallBackTask? Did you even learn PHP and the PM API?
  5. TryoneLegendZzz
    Offline

    TryoneLegendZzz Active Member

    Joined:
    May 31, 2015
    Posts:
    201
    Minecraft User:
    SavionLegendZzz
    this..
    PHP:
    $this->getServer()->getScheduler()->scheduleRepeatingTask(new CallbackTask([$this,"onJoin"]),10);
    and this...
    PHP:
    public function onJoin() {
        
    $p $this->getServer()->getOnlinePlayers();
        
    $p->sendTip("Welcome To Savion's Test Server!!!");
           

    }
  6. aliuly
    Offline

    aliuly Notable Member Plugin Developer

    Joined:
    Feb 8, 2014
    Posts:
    1,086
    Plugins:
    17
  7. TryoneLegendZzz
    Offline

    TryoneLegendZzz Active Member

    Joined:
    May 31, 2015
    Posts:
    201
    Minecraft User:
    SavionLegendZzz
    i just started to learn .-.
  8. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Wat
    $p will become an array.
    And you are trying to send it to everyone?
    And who do you want to send that message to? Why did you use a repeating task?

Share This Page

Advertisement