<?php

namespace Lunarelly\Tasks;

use pocketmine\plugin\PluginBase;
use pocketmine\Server;
use pocketmine\Player;
use pocketmine\scheduler\PluginTask;
use Lunarelly\Main;

class Broadcaster extends PluginTask {
	
	public function __construct(Main $main) {
		$this->main = $main;
		parent::__construct($main);
		}
		
		public function onRun($currentTicks) {
		  foreach($this->main->getServer()->getOnlinePlayers() as $players) {
			$rand = mt_rand(1, 4);
			if($rand == 1) {
				$message = "§8(§bB§aG§8) §fDiscord: §bdiscord.gg/bluegames";
				}
			if($rand == 2) {
				$message = "§8(§bB§aG§8) §fServer by: §bVillagerBoy, SevenZero";
				}
			if($rand == 3) {
				$message = "§8(§bB§aG§8) §fHosted By: §bExoticNodes.xyz";
				}
			if($rand == 4) {
				$message = "§8(§bB§aG§8) §fLooking to report a player? Use:§b /report <player> <reason>";
				}
			$players->sendMessage($message);
			}
			}
			}
			?>