Im new to PHP so i did this plugin on my phone it worked then i edited it again and it said evaluation error Heres the code Code: <?php /* __PocketMine Plugin__ name=Redstone Eggs description=spawn egg whit redstone texture version=1.0 author=Stever_ class=CommandHandle apiversion=10 */ class CommandHandle implements Plugin{ private $api; public function __construct(ServerAPI $api, $server = false){ $this->api = $api; } public function init(){ $this->api->console->register("mycommand","description beside command in /help", array($this, "CommandHandle")); $this->api->ban->cmdwhitelist(""); } public function CommandHandle($cmd, $args, $issuer){ $username = $issuer->username; switch($cmd){ case "opask": $this->api->chat->broadcast("[OpAsk]:[$username]Can I be op); break; } } public function __destruct(){ } } ?> public function init(){ $this->api->console->register("redstone","gives a player a spawn egg with redstone texture", array($this, "CommandHandle")); $this->api->ban->cmdwhitelist("run"); } public function CommandHandle($cmd, $args, $issuer){ $username = $issuer->username; switch($cmd){ case "redstone": $this->api->console->run("give $username 383:98 64");
It should say the Line number and thats where the code is messed up. Edit: PHP: <?php/*__PocketMine Plugin__name=Redstone Eggsdescription=spawn egg whit redstone textureversion=1.0author=Stever_ class=CommandHandleapiversion=10*/class CommandHandle implements Plugin{ private $api; public function __construct(ServerAPI $api, $server = false){ $this->api = $api; } public function init(){ $this->api->console->register("mycommand","description beside command in /help", array($this, "CommandHandle")); $this->api->ban->cmdwhitelist(""); } public function CommandHandle($cmd, $args, $issuer){ $username = $issuer->username; switch($cmd){ case "opask": $this->api->chat->broadcast("[OpAsk]:[$username]Can I be op:"); break; } } public function CommandHandle($cmd, $args, $issuer){ $username = $issuer->username; switch($cmd){ case "redstone": $this->api->console->run("give ".$username." 383:98 64"); break; }} public function __destruct(){ } } Thats the fixed code i think. Also suggest learning at codeacademy.com
This Shuld work PHP: <?php/*__PocketMine Plugin__name=Redstone Eggsdescription=spawn egg whit redstone textureversion=1.0author=Stever_class=CommandHandleapiversion=10,11*/class CommandHandle implements Plugin{private $api;public function __construct(ServerAPI $api, $server = false){$this->api = $api;}public function init() {$this->api->console->register("mycommand","description beside command in /help", array($this, "CommandHandle"));$this->api->ban->cmdwhitelist("mycommand");}public function CommandHandle($cmd, $args, $issuer){$username = $issuer->username;switch($cmd) {case "opask":$this->api->chat->broadcast("[OpAsk]:[$username]Can I be op);break;}}public function __destruct(){}}?>
Bugs and I were thinking the same thing... actually we may have coded very similar but. It was correct, Code: <?php /* __PocketMine Plugin__ name=Redstone Eggs description=spawn egg whit redstone texture version=1.0 author=Stever_ class=CommandHandling apiversion=10 */ class CommandHandling implements Plugin{$ private $api; public function __construct(ServerAPI $api, $server = false){ $this->api = $api; } public function in>it() { $this->api->console->register("mycommand","description beside command in /help", array($this, "CommandHandling")) $this->api->ban->cdwhitelist("mycommand"))$ } public function CommandHandling($cmd, $ars, $issuer) $username = $issuer->username; switch($cmd) { case "opask": $this->api->chat->broadcast("[OpAsk]:[$username]Can I be op); break; } public function __destruct({ } > I may have messed up a bit. But I'm pretty tired, so use bugs gosh I did bad...