public function onRun(array $args, Player $player) { if (!isset($args[0])) { return self::WRONG_USE; } $name = $args[0]; if (preg_replace($this->main->getFactionNamingRule(), "", $name) !== "") { return $this->getMain()->getFactionNameErrorMsg(); } elseif (is_int($this->getMain()->getFList()->getFactionID($name))) { return "A faction with name \"{$name}\" already exists!"; } Faction::newInstance($name, $player->getName(), $this->getMain()->getDefaultRanks(), $this->getMain()->getDefaultRank(), $this->getMain()->getDefaultAllyRank(), $this->getMain()->getDefaultTruceRank(), $this->getMain()->getDefaultStdRank(), $this->main); $this->main->getServer()->broadcast("[PF] A new faction called {$name} has been created!", Server::BROADCAST_CHANNEL_USERS); return ""; }