why this is not working? PHP: <?phpnamespace ServerL;use pocketmine\player;use pocketmine\server;use pocketmine\inventory\inventory;use pocketmine\command\commandsender;use pocketmine\event\player\playerjoinevent;use FormAPI\src\jojoe77777\FormAPI\simpleform;use Doxestic\ServerL\UI;use pocketmine\plugin\pluginbase;use pocketmine\item\item;use pocketmine\event\player\Pl;class main extends PluginBase{ public function onenable(){ $this->getlogger()->info("Plugin Enabled..."); } public function givep(){ $this->getPlayer()->getname(); $player = $this->getplayer()->getname(); if($player->hasplayedbefore !== true){ $this->$player->additem(347)->setCustomName("Select server"); } } public function onuse(){ $item = $player->getname()->PlayerItemHeldEvent()->getitem(); if($item == 347){ $this->UI(); return true; } else{ return false; } }}
That is wrong because if you you do that it will not register properly, and just do use jojoe77777\FormAPI\simpleform
1) Captilization matters 2) Your function will never be called 3) Listener not registered 4) getPlayer is NOT a part of your plugin's main 5) $player is not defined in "onuse" 6) UI is NOT a function in your Main 7) hasPlayedBefore is a function, NOT a Variable in Player.php 8) The arguments for "addItem" are invalid 9) Wth is "$this->$player" it should just be $player 10) $player is defined as the NAME of the player?? So let's give an item to a string, just yes. 11) I- wha- TLDR:
Whether OP had implemented Listener or not, he would still get errors (from code), and the functions will never be called.
My Guy I did not know you will be making a fucking test so chill out with you being mad at me, atleast say it was a test lmfao like what
?? When did I say I was mad at you? Th you even getting that from ?? I just answered his/her question like ⁉️ "fucking test" No, it's the answer OP asked for. Question: Why is this not working? Quit your BS while you're at it too.
This is your third thread containing shit code that just vaguely resembles php. For the love of god, show some respect and try to learn at least a bit of php before attempting to make a plugin.