Great suggestion! Ive just got Manu Admin Mod for my server, and first thing i did was a small corrections to !tempban command so admins can ban for different amount of time.
In basiccommands.php i change part of tempBan method
PHP
if (!empty($parameters)) {
$reason = implode(" ", $parameters);
}
else {
$reason = false;
}
if ($this->players[$tokick]->tempBan($reason)) {
to this
PHP
if (!empty($parameters)) {
if (is_numeric($parameters[0])) {
$duration = $parameters[0];
unset($parameters[0]);
}
$reason = implode(" ", $parameters);
}
else {
$reason = false;
$duration = false;
}
if ($this->players[$tokick]->tempBan($duration, $reason)) {
Alles anzeigen
And in player.class.php i change this
PHP
public function tempBan($reason = false) {
if (!$reason) {
$reason = $this->mod->getCV("kickban", "defaultbanreason");
}
if ($this->mod->getCV("kickban", "usepb")) {
$result = $this->rcon->rcon("pb_sv_kick ".$this->getPbid()." ".$this->mod->getCV("kickban", "pbtempbanduration")." $reason");
to this
PHP
public function tempBan($duration = false, $reason = false) {
if (!$duration) {
$duration = $this->mod->getCV("kickban", "pbtempbanduration");
}
if (!$reason) {
$reason = $this->mod->getCV("kickban", "defaultbanreason");
}
if ($this->mod->getCV("kickban", "usepb")) {
$result = $this->rcon->rcon("pb_sv_kick ".$this->getPbid()." ".$duration." ".$reason);
And it worked! Atleast for me and atleast for now.
With this you can do
!tempban Player 15 for teamkilling
to ban player for 15 minutes with reason 'for teamkilling' or
!tempban Player for teamkilling
to ban player for your default amount of time with the same reason.