Hello ! I am french and i little speak english, i would like to create a Popup repeated and the color change. I don't know how to create a plugin for that. Please help me. Thank you for an answer !
This might be helpful, and also I believe there have already been threads about this. Schedule this task every 10 seconds. PHP: class sendPopupExtended extends PluginTask{ private static $players=array(); public function __construct($plugin){ parent::__construct($plugin); } public static function queuePopup(Player $player, $popup, $time){ $c = count(self::$players); array_push(self::$players, array($player, $popup, ($time * 20), $c)); } public function onRun($tick){ foreach(self::$players as $player){ if(($player[2] - 10) >= 0 and $player[0]->isOnline()){ $player[0]->sendPopup($player[1]); self::$players[$player[3]][2] -= 10; }else{ unset(self::$players[$player[3]]); } } }}
Yeah i think it's work but i don't know to create plugin. Please give me more informations i am a noob in that! sorry for bad english.
Because of pthreads bugs. Just avoid using static properties. Why don't you just save the array in your main class's instance?