working on a plugin and referencing glitches function list something i was curious about was the difference between using isOP and PermissionsCheck example: say im using a command and i only want a staff member to be able to use it, the correct way would be $this>api>ban>isop right? Now if I'm using the permissions plus plugin would i use permissioncheck instead or since im using that is defining staff redundant? second question: If I want to see on the console that someone used a command (example: "joe-schmoe teleported to world B") how would i go about that (cannot for the life of me figure that out) x.x Thanks in advanced! ^_^
For number one, that would be how you check if the player is OP or not. If you want to check their rank in PermissionPlus, use PHP: $user_permission = $this->api->dhandle("get.player.permission", $username); but you have to set what $username is beforehand (I usually use $username = $issuer->username. Then you can check their rank with something like PHP: if($user_permission = GUEST){ $this->api->chat->broadcast("You just checked a player's rank!");} I hope this helps
Also, if you just want to check if a player is OP, do: For a command: PHP: $username = $issuer->username;if($this->api->ban->isOP($username) == true){//Random code}else{//More random code} For an event: PHP: $username = $data["player"]->username;if($this->api->ban->isOP($username) == true){//Random code}else{//More random code}
i saw something about debug lvl before, how do you change that? tried echo before and it gave me errors, guessing thats a no-go. thanks ^_^
ok, that makes sense. defining user and adding a handler to check the permission lvl, thought that was the way to go but havint messed with this yet. thanks, gave me a duh moment and clarity moment at the same time ^_^
ok, so I am on the right track. (whew) focusing on the former: PHP: case "protect": if($this->api->ban->isOp($issuer->username) == false){return("This command can only use by an OP. ");} this would be the correct format for someone who is not op and it would tell them only an op can use this comand, correct?
ok so: PHP: case "protect": if($this->api->ban->isOp($issuer->username) == false){return "This command can only use by an OP. ";} correct?