hello guys, so i want to send Players ( Only Ops) an message on Join. Sadly isop() doesnt work anymore so does anyone has an alternative? Im really struggling
You can still do it that way. Just use $this->getServer()->isOp("playername"); It could be like this. public function onJoin(PlayerJoinEvent $event) { $player = $event->getPlayer(); $event->setJoinMessage(""); if($this->getServer()->isOp("playername")) { $player->sendMessage("You're an operator!! This is your customized join message"); } }
if($this->getServer()->isOp("playername")) { i ddont understand how this line gets the player, playername must be changed iinto something else or not
Nono. With this function the server looks for the playername in the op list, so you just have to put in there the variable that contains the playername. This changed since PMMP started using API 4.0.0 instead of 3.0.0 I will do an example for you, wait
Here it is. Check the main php and test the plugin as you like. If you have more questions, you can add me in Discord SVega#6683