private function cmd($cmd = 'say ERROR :D', $args = NULL) { if (is_string($args)) { $cmd .= $args; } elseif (is_array($args)) { $cmd .= implode(' ', $args); } Shadowcmd::onTrigger($player, $cmd); }
/** * Execute a remote command. * @param SR_Player $player * @param SR_Player $remote * @param array $args */ public static function onRemote(SR_Player $player, SR_Player $remote, array $args) { # Enable remote output. $remote->setRemotePlayer($player); # Execute command. $back = Shadowcmd::onTrigger($remote, implode(' ', $args)); # Disable remote output. $remote->unsetRemotePlayer(); # Return result. return $back; }
public static function onTrigger(Dog_User $user, $msg) { if ($user->isRegistered() && !$user->isLoggedIn()) { if (false !== ($mod_al = Dog_Module::getModule('AutoLogin'))) { $mod_al instanceof DOGMOD_AutoLogin; $mod_al->onTryAutoLogin(); } # You need to login to play. return Dog::reply(DOGMOD_Shadowlamb::instance()->lang('0001')); } if (false === ($player = self::getPlayerForUser($user))) { return Dog::reply('Can not get Player for user ' . $user->getName() . '.'); } SR_Tell::onTell($player); # Do it! Shadowcmd::onTrigger($player, $msg); }
public function execute(SR_RealNPC $npc) { return Shadowcmd::onTrigger($npc, $this->command); }
public function ai_act($message) { echo "AI_ACT: {$message}\n"; return Shadowcmd::onTrigger($this, $message); }