It doesn't work for a temporary ban
Fix
Code
public function tempBan($guid, $parameters) {
$parastring = implode(" ",$parameters);
if (strpos($parastring, "\\") !== false) {
list($player, $parameters) = explode("\\", $parastring);
$player = trim($player);
$parameters = array(trim($parameters));
}
else {
$player = array_shift($parameters);
}
$tokick = $this->mod->findPlayerGuid($player);
if (!$tokick) {
$this->players[$guid]->say($this->mod->getLngString("playerNotFound", array("<SEARCH>"), array($player)));
}
else {
//Check if there is enough power
if($this->players[$tokick]->getNeededPower() > $this->players[$guid]->getPower()){
$this->players[$guid]->say($this->mod->getLngString("morePowerNeeded"));
return false;
}
if ($this->players[$tokick]->isProtected()) {
$this->players[$guid]->say($this->mod->getLngString("cantKickProtected"));
return false;
}
if (!empty($parameters)) {
if (is_numeric($parameters[0]) && $parameters[0] > 0) {
$time = array_shift($parameters);
if ($time > $this->mod->getCV("kickban", "maxtempbantime")) {
$time = $this->mod->getCV("kickban", "maxtempbantime");
}
}
else {
$time = false;
}
if (!empty($parameters)) {
$reason = implode(" ", $parameters);
$this->mod->findReason($reason);
}
else {
$reason = false;
}
}
else {
$reason = false;
$time = false;
}
if($this->mod->getCV("kickban", "forcereason") && !$reason){
$this->players[$guid]->say($this->mod->getLngString("forceReason"));
return false;
}
if ($this->players[$tokick]->tempBan($reason, $time, $guid)) {
if (!$this->mod->getCV("kickban", "announce")) {
$this->players[$guid]->say($this->mod->getLngString("playerTempBanned", array("<PLAYER>"), array($this->players[$tokick]->getName())));
}
}
else {
$this->players[$guid]->say($this->mod->getLngString("anyError"));
}
}
}
Alles anzeigen