Hi. I'm developing some plugins, but I can't find how use $args. Is there any "tutorial" for using /command a b c d e f? (I can use only /command or /command a)
$args is an array, so to get first arg do $arg[0], for arg 2 do $arg[1]... you can do this : Code: switch ($arg[0]){ case "a": //WhatYouWantToDo break; case "b": //WantYouWantToDo break; }
Will It be OK? PHP: switch ($args[0]){case "a":switch ($args[1]){case "do":$sender->sendMessage("You typed /command a do!");break;}case "b":$sender->sendPopup("You typed /command b!");break;}
$args is the array of command arguments, each element for one space-separated word. Read http://php.net/arrays for more information.