Haii, How do i let the first OP in the ops.txt to let ONLY him/her use a specific command? Like on a server host(I didn't put a name because it would count as advertising), there is a command that only the first OP can only use it.
PHP: public function onPreprocess(PlayerCommandPreProcessEvent $event){ if($event->getMessage() == "/<command>"){if(file($this->getDataPath()."ops.txt")[0] != $event->getPlayer()->getName()){$event->setCancelled();}}}
I'd add strtolower for the comparison too, but more importantly if you have more than one op they could deop the first person, unless you limit /deop too... or use "chattr +i ops.txt" to prevent anyone modifying it (Linux only, and you'd need access to the command line).