Hello Guys, im developing a Plugin but, i need a position set and then get the area set, how can i do that? please, help, its urgent i have tried it, but i can't find out how to do it! PLEASE!!! public function onCommand(\pocketmine\command\CommandSender $sender, \pocketmine\command\Command $command, $label, array $args) { $name = $player->getDisplayName(); if($name == D4nl0g){ switch (strtolower($command->getUsage())){ case 'setpos1': $this-> } Thats my code so far
Hi 1. $name will not be defined cuz it will crash on that part! PHP: // You used$player// instead of$sender 2. Why you use $player->getDisplayName()? use $player->getName(); 3. switch($command->getName()); Not ->getUsage(); 4. : PHP: $this->positions = array();public function onCommand(...){switch(...){case "setpos1":$this->positions[$sender->getName()]['pos1'] = $sender->getPosition();$sender->sendMessage('First position set to: '.$sender->getFloorX().":".$sender->getFloorY().":".$sender->getFloorZ().".");return true;}} 5. Use PHP: So we could read code easier!
The learn it on internet. Not videos. Here are the docs: http://jenkins.pocketmine.net/job/PocketMine-MP-doc/doxygen/index.html
No, i know PHP, i made plugins, but only arguments with $sender and broadcastmessage and things like that
That isn't PHP. Those are only parts of how to make a plugin, but that isn't even coding because you don't even what they mean. If you so, you would spot the lack of quotes in the very first case.