You are trying to make plugins without knowing PHP. BTW if you didn't care, you wouldn't have replied.
Just make a config with something like "Task: enabled" When the timer gets to 0 use the task to switch it to "disabled". In the event do: PHP: If($taskConfig == "disabled") { $event->setCancelled(true);} You can also do it using dynamic arrays.
just PHP: public $timer; timer: PHP: public function onRun($currentTick){if($currentTick >= 300){$this->owner->timer = false; // Disabled}}
Can you stop targetting people? Just assume you don't know whether the questioner knows PHP and answer directly. When a match starts, save the time. So in PlayerMoveEvent, if time() - $startTime < 30, cancel the event. You don't need to use scheduler for this.
well gamecrafter, people's here are not asking for "learn php" "that's impossible" "make your own plugin" and I think you better stop replying you're just trying to get hate
Its a really annoying thing to say and I hate when people on these forums say it. If you don't have anything that can actually help the person other than "Learn PHP" just don't say anything at all.
Indeed. It was a fun phrase to use initially, but now you are abusing it so much you ruined all the fun, @Gamecrafter.
Well, sorry for ruining the fun, I'll come up with something new. Learn HTML(which has nothing to do with PHP).
No one is hating. All I was saying is that people come to get help and spamming "learn php" is not helpful at all. Plus its getting old and annoying.
Yes, it does help. Some people come in here knowing only a little HTML and they're saying they want to make a PocketMine plugin, and the last time I checked, was written in PHP.
So can you just assume that they know PHP and help directly? We encourage but cannot force people to learn PHP. I myself never officially learnt PHP but got to how I am today by using my brain and looking at examples.
Hey im getting an error. Spoiler: Error [00:59:49] [Server thread/CRITICAL]: Could not execute task HG\Timer: Argument 1 passed to HG\Main:nBlockBreak() must be an instance of pocketmine\event\block\BlockBreakEvent, null given, called in C:\Users\Jesus\Downloads\PocketMine-MP\plugins\HG\src\HG\Timer.php on line 35 and defined [00:59:49] [Server thread/NOTICE]: InvalidArgumentException: "Argument 1 passed to HG\Main:nBlockBreak() must be an instance of pocketmine\event\block\BlockBreakEvent, null given, called in C:\Users\Jesus\Downloads\PocketMine-MP\plugins\HG\src\HG\Timer.php on line 35 and defined" (E_RECOVERABLE_ERROR) in "/HG/src/HG/Main" at line 127