So i'm trying to fix it but nothing works Error: http://pastebin.com/PmF71vrL Crashdump: http://pastebin.com/QExjQ2dj Code: PHP: if($args[0] == "leader") { if(!isset($args[1])) { $sender->sendMessage($this->plugin->formatMessage("Usage: /f leader <player>")); return true; } if(!$this->plugin->isInFaction($sender->getName())) { $sender->sendMessage($this->plugin->formatMessage("You must be in a faction to use this!")); } if(!$this->plugin->isLeader($player)) { $sender->sendMessage($this->plugin->formatMessage("You must be leader to use this")); } if($this->plugin->getPlayerFaction($player) != $this->plugin->getPlayerFaction($args[1])) { $sender->sendMessage($this->plugin->formatMessage("Add player to faction first!")); } if(!$this->plugin->getServer()->getPlayerExact($args[1])->isOnline()) { $sender->sendMessage($this->plugin->formatMessage("Player not online!")); } $factionName = $this->plugin->getPlayerFaction($player); $factionName = $this->plugin->getPlayerFaction($player); $stmt = $this->plugin->db->prepare("INSERT OR REPLACE INTO master (player, faction, rank) VALUES (:player, :faction, :rank);"); $stmt->bindValue(":player", $player); $stmt->bindValue(":faction", $factionName); $stmt->bindValue(":rank", "Member"); $result = $stmt->execute(); $stmt = $this->plugin->db->prepare("INSERT OR REPLACE INTO master (player, faction, rank) VALUES (:player, :faction, :rank);"); $stmt->bindValue(":player", strtolower($args[1])); $stmt->bindValue(":faction", $factionName); $stmt->bindValue(":rank", "Leader"); $result = $stmt->execute(); $sender->sendMessage($this->plugin->formatMessage("You are no longer leader!", true)); $this->plugin->getServer()->getPlayer($args[1])->sendMessage($this->plugin->formatMessage("You are now leader \nof $factionName!", true)); $this->plugin->updateTag($sender->getName()); $this->plugin->updateTag($this->plugin->getServer()->getPlayer($args[1])->getName()); } So how can this be fixed?
PHP: if($args[0] == "leader") { if(!isset($args[1])) { $sender->sendMessage($this->plugin->formatMessage("Usage: /f leader <player>")); return true; } if(!$this->plugin->isInFaction($sender->getName())) { $sender->sendMessage($this->plugin->formatMessage("You must be in a faction to use this!")); } if(!$this->plugin->isLeader($player)) { $sender->sendMessage($this->plugin->formatMessage("You must be leader to use this")); } if($this->plugin->getPlayerFaction($player) != $this->plugin->getPlayerFaction($args[1])) { $sender->sendMessage($this->plugin->formatMessage("Add player to faction first!")); } $p = $args[1]; if($p != $this->plugin->getServer()->getPlayerExact($args[1])) { $sender->sendMessage($this->plugin->formatMessage("Player not online!")); } $factionName = $this->plugin->getPlayerFaction($player); $factionName = $this->plugin->getPlayerFaction($player); $stmt = $this->plugin->db->prepare("INSERT OR REPLACE INTO master (player, faction, rank) VALUES (:player, :faction, :rank);"); $stmt->bindValue(":player", $player); $stmt->bindValue(":faction", $factionName); $stmt->bindValue(":rank", "Member"); $result = $stmt->execute(); $stmt = $this->plugin->db->prepare("INSERT OR REPLACE INTO master (player, faction, rank) VALUES (:player, :faction, :rank);"); $stmt->bindValue(":player", strtolower($args[1])); $stmt->bindValue(":faction", $factionName); $stmt->bindValue(":rank", "Leader"); $result = $stmt->execute(); $sender->sendMessage($this->plugin->formatMessage("You are no longer leader!", true)); $this->plugin->getServer()->getPlayer($args[1])->sendMessage($this->plugin->formatMessage("You are now leader \nof $factionName!", true)); $this->plugin->updateTag($sender->getName()); $this->plugin->updateTag($this->plugin->getServer()->getPlayer($args[1])->getName()); }