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

Solved Task FloatingText

Comments in 'Plugin Development' started by CaptainKenji17, Jul 30, 2016.

  1. CaptainKenji17
    Offline

    CaptainKenji17 Active Member

    Joined:
    Apr 22, 2014
    Posts:
    252
    Minecraft User:
    CaptainKenji17
    How?

    Example onTask(){
    $color = array("§1", "§2");
    array(rand? what Am I doing here?);
    $ft = foatingTextParticle($color, "How?");
    $ft = setinvisible();?

    please no butthurt comments :( Im noob plugin developer who is trying to improve and in-learning of php.
  2. Svile
    Offline

    Svile Active Member

    Joined:
    Mar 30, 2015
    Posts:
    239
    Minecraft User:
    svile
    Try to explain what would you like to do
    PocketKiller and Extreme_Heat like this.
  3. Extreme_Heat
    Offline

    Extreme_Heat Active Member

    Joined:
    Apr 19, 2016
    Posts:
    76
    Minecraft User:
    Extreme_Heat
  4. CaptainKenji17
    Offline

    CaptainKenji17 Active Member

    Joined:
    Apr 22, 2014
    Posts:
    252
    Minecraft User:
    CaptainKenji17
  5. Extreme_Heat
    Offline

    Extreme_Heat Active Member

    Joined:
    Apr 19, 2016
    Posts:
    76
    Minecraft User:
    Extreme_Heat
    Sorry? I simply made the statement that you should learn PHP before attempting to make PocketMine plugins. This is a standard response I make, so don't think that I'm somehow targeting you.

    Is there a reason that you are so interested in making PocketMine plugins without taking the time to properly learn PHP?
  6. CaptainKenji17
    Offline

    CaptainKenji17 Active Member

    Joined:
    Apr 22, 2014
    Posts:
    252
    Minecraft User:
    CaptainKenji17
    I know basic PHP I was lazy to correct it. and yes someone have already telled me how to make this and this thread is already solved so bye . LOCKED .
  7. BalAnce
    Offline

    BalAnce Active Member

    Joined:
    Mar 10, 2015
    Posts:
    125
    Minecraft User:
    BalAnce
    something like this? (meant for others)
    PHP:
    <?php
    namespace something;

    use 
    pocketmine\level\particle\FloatingTextParticle;
    use 
    pocketmine\plugin\Plugin;
    use 
    pocketmine\scheduler\PluginTask;

    class 
    FTPUpdate extends PluginTask{
        public 
    $ft null;
        public function 
    __construct(Plugin $owner)
        {
            
    parent::__construct($owner);
        }

        public function 
    onRun($currentTick)
        {
            if (
    $this->ft instanceof FloatingTextParticle){
                
    $this->ft->setInvisible(true);
            }
            
    $color_array = ["§1""§2"];
            
    $title "";
            
    $msg "something here asfajbsfdj";
            
    $r mt_rand(0,count($color_array) - 1);
            
    //Make sure to define $vector3
        
            
    $ft = new FloatingTextParticle($vector3$color_array[$r].$msg$title);
            foreach (
    $this->getOwner()->getServer()->getOnlinePlayers() as $player){
                
    $player->getLevel()->addParticle($ft,$player);
            }
            
    $this->ft ft;
        }
    }
    CaptainKenji17 likes this.
  8. PocketKiller
    Offline

    PocketKiller Notable Member

    Joined:
    Jul 20, 2015
    Posts:
    741
    He is right, so why that? then yours is more useless than @Extreme_Heat's.
    @CaptainKenji17 Please explain more, do you want a floating text that changes by time? or just a floating text?
    also you are not a noob, you are just a beginner. :)
    Last edited by a moderator: Jul 31, 2016
    Primus likes this.
  9. Extreme_Heat
    Offline

    Extreme_Heat Active Member

    Joined:
    Apr 19, 2016
    Posts:
    76
    Minecraft User:
    Extreme_Heat
    (•_•) ( •_•)>⌐■-■ (⌐■_■)

    As someone who has been programming for years, it's easy to pass off the importance of actually learning a language and going straight into making things.

    This forums is for PocketMine specific help, not the learn-how-to-use-PHP type of help.There are many other places for that. That said, I think I've substituted the job of Google by providing the OP the links so they can actually learn PHP. It was never meant to be an insult.
    Last edited by a moderator: Jul 31, 2016
    Primus and PocketKiller like this.
  10. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    He wants color changing text.
  11. CaptainKenji17
    Offline

    CaptainKenji17 Active Member

    Joined:
    Apr 22, 2014
    Posts:
    252
    Minecraft User:
    CaptainKenji17
    never knew you can do $color_array =...
    btw my simle method was
    $color = array(..);
    $rand =array_rand($color);

    and then just add "{$color[$rand]}" on text

Share This Page

Advertisement