Beispiel #1
0
 private static function onGMNS(SR_Player $player, SR_Player $target, $arg)
 {
     $pid = $target->getID();
     if (strtolower($arg) === 'on') {
         if (false === SR_NoShout::setNoShout($pid, -1)) {
             return false;
         }
         return $player->message(sprintf('Banned %s from shouting.', $target->getName()));
     } elseif (strtolower($arg) === 'off') {
         if (false === SR_NoShout::setShout($pid)) {
             return false;
         }
         return $player->message(sprintf('Allowed %s to shout again.', $target->getName()));
     } elseif (0 < ($seconds = GWF_TimeConvert::humanToSeconds($arg))) {
         if (false === SR_NoShout::setNoShout($pid, $seconds)) {
             return false;
         }
         return $player->message(sprintf('Banned %s from shouting for %s.', $target->getName(), GWF_TimeConvert::humanDuration($seconds)));
     } else {
         $player->message(Shadowhelp::getHelp($player, 'gmns'));
         return false;
     }
 }