public static function execute(SR_Player $player, array $args) { if (count($args) === 0) { Shadowrap::instance($player)->reply(Shadowhelp::getHelp($player, 'shout')); return false; } $wait = SR_NoShout::isNoShout($player->getID()); if ($wait > 0) { $player->msg('1044', array(GWF_Time::humanDuration($wait))); // $player->message(sprintf('Please wait %s before you shout again.', GWF_Time::humanDuration($wait))); return false; } Shadowshout::shout($player, implode(' ', $args)); return true; }
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; } }