/** * Test handle() returns a command object */ public function testHandle() { $handler = new CommandHandler(); $commands = $handler->getCommands(); foreach (array_keys($commands) as $command) { $commandObject = $handler->handle(["command" => $command, "data" => "someData"], $this->getMockPlayer(), $this->getMockPlayerCollection()); $this->assertInstanceOf($commands[$command], $commandObject); } }
/** * 主要测试,测试正常情况 */ public function testMain() { ControlResolver::setAppPath(dirname(__FILE__) . '/'); AppHelper::Instance()->config("CMD_FILTER", ''); //恢复默认 $_POST["cmd"] = "test.test"; CommandHandler::run(); $this->assertEquals("test.test", file_get_contents(dirname(__FILE__) . "/temp/testForCmd.text")); $_GET["cmd"] = ""; CommandHandler::run(); $this->assertEquals("default.default", file_get_contents(dirname(__FILE__) . "/temp/testForCmd.text")); //输出异常 $_GET["cmd"] = "test.test"; $_GET["exc"] = "echo_exc"; CommandHandler::run(); $this->assertEquals("echo_exc", file_get_contents(dirname(__FILE__) . "/temp/testForCmd.text")); //一般异常 $_GET["cmd"] = "test.test"; $_GET["exc"] = "exc"; CommandHandler::run(); $this->assertEquals("exc", file_get_contents(dirname(__FILE__) . "/temp/testForCmd.text")); $_GET["cmd"] = "noHave"; CommandHandler::run(); $_GET["cmd"] = "Nocmd"; CommandHandler::run(); $_GET["cmd"] = "NoClassExist"; CommandHandler::run(); //测试控制过滤 AppHelper::Instance()->config("CMD_FILTER", '/Controller$/'); $_GET["cmd"] = "DefaultController"; CommandHandler::run(); $this->assertEquals("default.default", file_get_contents(dirname(__FILE__) . "/temp/testForCmd.text")); }
/** ** Init ** Initialize all factions. **/ public static function Init() { $factions = DB::GetAllFactions(); foreach ($factions as $name) { /* Load the faction source code */ $fixed_name = str_replace(' ', '_', $name); require_once "gamemodes/factions/{$fixed_name}.php"; $factiondata = DB::GetFactionData($name); $classname = 'Faction_' . $fixed_name; $newfaction = new $classname($name, $factiondata['color'], $factiondata['bank'], $factiondata['maxvehicles'], $factiondata['maxmembers'], $factiondata['membercount']); if ($factiondata['HQ'] != null) { $room = Houses::FindByDBID($factiondata['HQ']); if ($room) { $newfaction->SetHQ($room); } } if ($factiondata['bankfreezed'] == 1) { $newfaction->FreezeBank(); } Factions::Register($newfaction, $newfaction->GetHQ()); echo ">>>>> Loaded faction '{$name}'\n"; } /* Register common faction commands */ CommandHandler::Register('invite', 1, null, array('Factions', 'cmdInvite'), '[ID]', 1); CommandHandler::Register('uninvite', 1, null, array('Factions', 'cmdUninvite'), '[ID]', 1); CommandHandler::Register('rankup', 1, null, array('Factions', 'cmdRankup'), '[ID]', 1); CommandHandler::Register('rankdown', 1, null, array('Factions', 'cmdRankdown'), '[ID]', 1); CommandHandler::Register('duty', 1, null, array('Factions', 'cmdDuty'), '[on/off]', 1, -1000); CommandHandler::Register('open', 0, null, array('Factions', 'cmdOpen'), '', 1); CommandHandler::Register('close', 0, null, array('Factions', 'cmdClose'), '', 1); }
public function handleRequest() { $registry = SessionRegistry::getInstance(); $cmdHnd = CommandHandler::getInstance(); $cmd = $cmdHnd->getCommand($registry); $cmd->execute($registry, View::getInstance($registry)); }
/** * 启动 */ public static function start() { /* * ------------------------------------------------------ * 设置时区 * ------------------------------------------------------ */ date_default_timezone_set("Asia/Shanghai"); /* * ------------------------------------------------------ * 安全程序:关掉魔法引号,过滤全局变量 * ------------------------------------------------------ */ if (!is_php('5.4')) { ini_set('magic_quotes_runtime', 0); if ((bool) ini_get('register_globals')) { $_protected = array('_SERVER', '_GET', '_POST', '_FILES', '_REQUEST', '_SESSION', '_ENV', '_COOKIE', 'GLOBALS', 'HTTP_RAW_POST_DATA', '_protected', '_registered'); $_registered = ini_get('variables_order'); foreach (array('E' => '_ENV', 'G' => '_GET', 'P' => '_POST', 'C' => '_COOKIE', 'S' => '_SERVER') as $key => $superglobal) { if (strpos($_registered, $key) === FALSE) { continue; } foreach (array_keys(${$superglobal}) as $var) { if (isset($GLOBALS[$var]) && !in_array($var, $_protected, TRUE)) { $GLOBALS[$var] = NULL; } } } } } /* * ------------------------------------------------------ * 异常处理,错误处理等,记录错误日志 * ------------------------------------------------------ */ register_shutdown_function("_finish_handle"); set_exception_handler("_exception_handle"); set_error_handler("_error_handle"); /* * ------------------------------------------------------ * 注册自动加载方法 * ------------------------------------------------------ */ spl_autoload_register("Loader::autoload"); Loader::setClassDir((array) AppHelper::Instance()->config("APP_AUTOLOAD_PATH")); Loader::setSuffix((array) AppHelper::Instance()->config("CLASS_FILE_SUFFIX")); /* * ------------------------------------------------------ * ini 设置 * ------------------------------------------------------ */ //默认字符编码为UTF-8 ini_set('default_charset', 'UTF-8'); //日志初始 log_message(LOG_INFO, "初始处理完毕", \Utils\UtilFactory::getLogHandle()); //运行核心程序 log_message(LOG_INFO, "运行核心程序................"); CommandHandler::run(); }
public static function Init() { Callbacks::Instance()->Register(cOnPlayerPickUpPickup, null, array('Locations', 'OnPickUpPickup')); Callbacks::Instance()->Register(cOnPlayerEnterCheckpoint, null, array('Locations', 'OnPlayerEnterCheckpoint')); CommandHandler::Register('enter', 0, null, array('Locations', 'cmdEnter'), '', 1, -1000); CommandHandler::Register('exit', 0, null, array('Locations', 'cmdExit'), '', 1, -1000); Keybinds::Register(array(KEY_ACTION, KEY_ACTION), null, array('Locations', 'PlayerEnterExitKeybind')); echo ">>>>> Creating Location0 ...\n"; $location0 = new Location0(); }
/** * cleans command(s) of transfer * * @param $transfer * @return boolean */ function clean($transfer) { global $instanceCommandHandler; // initialize if needed if (!isset($instanceCommandHandler)) { CommandHandler::initialize(); } // call instance-method return $instanceCommandHandler->instance_clean($transfer); }
public static function Init() { Callbacks::Instance()->Register(cOnPlayerText, null, array('Messages', 'OnPlayerText')); Callbacks::Instance()->Register(cOnPlayerPrivmsg, null, array('Messages', 'OnPlayerPrivmsg')); CommandHandler::Register('l', 1, null, array('Messages', 'cmdLocal'), '[message]', 1, -1000); CommandHandler::Register('s', 1, null, array('Messages', 'cmdShout'), '[message]', 1, -1000); CommandHandler::Register('w', 2, null, array('Messages', 'cmdWhisper'), '[id] [message]', 1, -1000); CommandHandler::Register('me', 1, null, array('Messages', 'cmdMe'), '[message]', 1, -1000); CommandHandler::Register('/', 1, null, array('Messages', 'cmdAdminchat'), '[message]', 1, -1000); }
public static function Init() { new LSBank(); LSBank::$interest = 0.3; /* Register commands */ CommandHandler::Register('balance', 0, null, array('LSBank', 'cmdBalance'), '', 1); CommandHandler::Register('deposit', 1, null, array('LSBank', 'cmdDeposit'), '[amount]', 1); CommandHandler::Register('withdraw', 1, null, array('LSBank', 'cmdWithdraw'), '[amount]', 1); CommandHandler::Register('transfer', 2, null, array('LSBank', 'cmdTransfer'), '[ID] [amount]', 1); CommandHandler::Register('fbalance', 0, null, array('LSBank', 'cmdFbalance'), '', 1); CommandHandler::Register('fdeposit', 1, null, array('LSBank', 'cmdFdeposit'), '[amount]', 1); CommandHandler::Register('ftransfer', 2, null, array('LSBank', 'cmdFtransfer'), '[amount] [destination faction]', 1); }
public static function Init() { /* Register commands */ CommandHandler::Register('open', 0, null, array('Houses', 'cmdOpen'), '', 1); CommandHandler::Register('close', 0, null, array('Houses', 'cmdClose'), '', 1); CommandHandler::Register('buy', 0, null, array('Houses', 'cmdBuy'), '', 1); CommandHandler::Register('fbuy', 0, null, array('Houses', 'cmdFbuy'), '', 1); CommandHandler::Register('sell', 1, null, array('Houses', 'cmdSell'), '[price]', 1); CommandHandler::Register('unsell', 0, null, array('Houses', 'cmdUnsell'), '', 1); CommandHandler::Register('fridgestats', 0, null, array('Houses', 'cmdFridgestats'), '', 1); CommandHandler::Register('cook', 0, null, array('Houses', 'cmdCook'), '', 1); /* Generate cooking items */ Houses::RegisterCookItem('Pizza portion', 50, 4000, 70); Houses::RegisterCookItem('Full pizza', 100, 6000, 100); Houses::RegisterCookItem('Spaghetti', 200, 6000, 70); Houses::RegisterCookItem('Tuna', 300, 7000, 50); Houses::RegisterCookItem('Lobster', 500, 9000, 40); /* Generate menus */ Houses::$cookmenu = new Menu(null, 'Cook', array('Houses', 'cookStart'), array('Houses', 'cookStop'), 2, new Position(150, 150), 100, 50); Houses::$cookmenu->SetHeader('Meal', 0); Houses::$cookmenu->SetHeader('Food', 1); foreach (Houses::$cookitems as $item) { Houses::$cookmenu->Add($item->name, 0, ROW_ACTION, array('Houses', 'cookItem')); Houses::$cookmenu->Add($item->food, 1); } /* Create animations */ $cook_eat = new Animation('FOOD', 'eat_pizza', true, false, false, false, -1, true, 3600); $cook = new Animation('DEALER', 'shop_pay', true, false, false, false, -1, true, 4000, null, $cook_eat); Houses::$cookanim = $cook; /* Get all existing houses from database */ $houses = DB::GetAllHouses(); foreach ($houses as $name) { /* Replace the spaces in the name to underlines */ $fixed_name = str_replace(' ', '_', $name); $fixed_name = str_replace(',', '_', $fixed_name); require_once 'gamemodes/houses/' . $fixed_name . '.php'; $classname = 'House_' . $fixed_name; /* Load the database data for this house */ $data = DB::GetHouseData($name); $house = new $classname($name, $data['maxrooms'], $data['price']); $house->SetFridgeSize($data['fridgesize']); Houses::Register($house); echo ">>>>> Loaded house '{$name}'\n"; } }
public static function Init() { /* Register the admin commands */ CommandHandler::Register('admins', 0, null, array('Admin', 'cmdAdmins'), ''); CommandHandler::Register('kick', 2, null, array('Admin', 'cmdKick'), '[ID] [reason]'); CommandHandler::Register('suspend', 3, null, array('Admin', 'cmdSuspend'), '[ID] [time] [reason]'); CommandHandler::Register('unsuspend', 1, null, array('Admin', 'cmdUnsuspend'), '[exact name]'); CommandHandler::Register('goto', 1, null, array('Admin', 'cmdGoto'), '[ID]'); CommandHandler::Register('bring', 1, null, array('Admin', 'cmdBring'), '[ID]'); CommandHandler::Register('ajail', 3, null, array('Admin', 'cmdAjail'), '[ID] [time] [reason]'); CommandHandler::Register('aunjail', 1, null, array('Admin', 'cmdAunjail'), '[ID]'); CommandHandler::Register('givecash', 2, null, array('Admin', 'cmdGivecash'), '[ID] [amount]'); CommandHandler::Register('showme', 1, null, array('Admin', 'cmdShowme'), '[on/off]'); CommandHandler::Register('setfaction', 2, null, array('Admin', 'cmdSetfaction'), '[ID] [faction name]'); CommandHandler::Register('setrank', 2, null, array('Admin', 'cmdSetrank'), '[ID] [rank id]'); /* Register callbacks */ Callbacks::Instance()->Register(cOnPlayerConnect, null, array('Admin', 'OnPlayerConnect')); Admin::$showadmins = array_fill(0, MAX_PLAYERS, true); }
public static function Init() { /* Register commands and callbacks */ CommandHandler::Register('exercise', 0, null, array('Gym', 'cmdExercise'), '', 1); CommandHandler::Register('stopexercise', 0, null, array('Gym', 'cmdStopexercise'), '', 1); Callbacks::Instance()->Register(cOnPlayerDisconnect, null, array('Gym', 'OnPlayerDisconnect')); Callbacks::Instance()->Register(cOnPlayerKeyStateChange, null, array('Gym', 'OnPlayerKeyStateChange')); Callbacks::Instance()->Register(cOnPlayerSpawn, null, array('Gym', 'OnPlayerSpawn')); /* Create the animations */ $benchpress_getoff = new Animation('benchpress', 'gym_bp_getoff', false, false, false, false, 8100, true); $benchpress_exercise = new Animation('benchpress', 'gym_bp_up_smooth', true, false, false, false, -1, true, -1, $benchpress_getoff); $benchpress_anim = new Animation('benchpress', 'gym_bp_geton', false, false, false, false, 5200, true, 5100, $benchpress_getoff, $benchpress_exercise, array('Gym', 'startExercise')); Gym::$anims['benchpress'] = $benchpress_anim; $bike_getoff = new Animation('gymnasium', 'gym_bike_getoff', false, false, false, false, 1350, true); $bike_exercise = new Animation('gymnasium', 'gym_bike_pedal', true, false, false, false, -1, true, -1, $bike_getoff); $bike_anim = new Animation('gymnasium', 'gym_bike_geton', false, false, false, false, 1500, true, 1400, $bike_getoff, $bike_exercise, array('Gym', 'startExercise')); Gym::$anims['bike'] = $bike_anim; $tread_getoff = new Animation('gymnasium', 'gym_tread_getoff', false, false, false, false, 3000, true); $tread_exercise = new Animation('gymnasium', 'gym_tread_jog', true, false, false, false, -1, true, -1, $tread_getoff); $tread_anim = new Animation('gymnasium', 'gym_tread_geton', false, false, false, false, 2250, true, 2200, $tread_getoff, $tread_exercise, array('Gym', 'startExercise')); Gym::$anims['tread'] = $tread_anim; /* Make the list of keys */ Gym::RegisterKey(KEY_ACTION, 'TAB'); Gym::RegisterKey(KEY_CROUCH, 'CROUCH'); Gym::RegisterKey(KEY_SPRINT, 'SPRINT'); Gym::RegisterKey(KEY_JUMP, 'JUMP'); Gym::RegisterKey(KEY_WALK, 'WALK'); Gym::RegisterKey(KEY_SECONDARY_ATTACK, 'ENTER V.'); /* Initialize arrays */ Gym::$players_key = array_fill(0, MAX_PLAYERS, -1); Gym::$players_gained = array_fill(0, MAX_PLAYERS, -1); Gym::$draws = array_fill(0, MAX_PLAYERS, null); /* Register all exercise machines */ echo ">>>>> Registering all exercise machines locations ...\n"; /* Madd doggs */ Gym::Register('benchpress', new Position(1233.6235, -769.3942, 1084.0, 180), new Position(1233.6235, -767.3942, 1086)); Gym::Register('bike', new Position(1242.4896, -767.7238, 1084.0121, 90), new Position(1239, -766.7238, 1086)); Gym::Register('tread', new Position(1226.5122, -762.5506, 1084.0055, 180), new Position(1226.5352, -768.6758, 1087)); }
/** * set sharekill of a transfer * * @param $transfer * @param $sharekill * @param $autosend * @return boolean */ function setSharekill($transfer, $sharekill, $autosend = false) { // set sharekill $this->sharekill = $sharekill; // add command CommandHandler::add($transfer, "s" . $this->sharekill); // send command to client if ($autosend) { CommandHandler::send($transfer); } // return return true; }
/** * set download rate of a transfer * * @param $transfer * @param $downrate * @param $autosend */ function setRateDownload($transfer, $downrate, $autosend = false) { // set rate-field $this->drate = $downrate; // add command CommandHandler::add($transfer, "d" . $downrate); // send command to client if ($autosend) { CommandHandler::send($transfer); } }
$ch->setRateUpload($transfer, $settingsNew['max_upload_rate']); } // upload-rate if ($settingsNew['max_download_rate'] != $settingsCurrent['max_download_rate']) { $ch->setRateDownload($transfer, $settingsNew['max_download_rate']); } // runtime if ($settingsNew['die_when_done'] != $settingsCurrent['die_when_done']) { $ch->setRuntime($transfer, $settingsNew['die_when_done']); } // sharekill if ($settingsNew['sharekill'] != $settingsCurrent['sharekill']) { $ch->setSharekill($transfer, $settingsNew['sharekill']); } // send command-buffer to client CommandHandler::send($transfer); // set message-var $tmpl->setvar('message', "settings saved + changes sent to client"); } else { /* don't send changes or no changes to send */ // set message-var $tmpl->setvar('message', "settings saved"); } } } else { /* display */ // set save-var $tmpl->setvar('isSave', 0); // client-chooser if ($ch->type == "torrent") { $tmpl->setvar('enableClientChooser', 1);
<?php require_once 'vendor/autoload.php'; //Initialzing CommandHandler class with config and cli arguments $commandHandler = CommandHandler::init(); $commandHandler->setCommand($argv); //launch command handler $commandHandler->handle();
/** * 命令模式入口函数 */ static function run() { $instance = new CommandHandler(); $instance->init(); $instance->_handleRequest(); }
public static function Init() { /* Initialize the skills */ Players::RegisterSkill(SKILL_COOKING, 5, 'cooking', 'Cooking'); Players::RegisterSkill(SKILL_LUCK, 10, 'luck', 'Luck'); Players::RegisterSkill(SKILL_ALCOHOLIC, 5, 'alcoholic', 'Alcoholic'); $skill = Players::RegisterSkill(SKILL_DRUGSADDICT, 4, 'drugsaddict', 'Drugs addict'); $skill->SetReqLevel(2, 4); $skill->SetReqLevel(3, 7); $skill->SetReqLevel(4, 11); $skill = Players::RegisterSkill(SKILL_PROFKILLER, 6, 'profkiller', 'Professional killer'); $skill->SetReqLevel(2, 6); $skill->SetReqLevel(3, 8); $skill->SetReqLevel(4, 11); $skill->SetReqLevel(5, 15); $skill->SetReqLevel(6, 20); $skill = Players::RegisterSkill(SKILL_GUNSDEALER, 6, 'gunsdealer', 'Guns dealer'); $skill->SetReqLevel(2, 3); $skill->SetReqLevel(3, 5); $skill->SetReqLevel(4, 8); $skill->SetReqLevel(5, 12); $skill->SetReqLevel(6, 17); $skill = Players::RegisterSkill(SKILL_DRUGSDEALER, 4, 'drugsdealer', 'Drugs dealer'); $skill->SetReqLevel(2, 3); $skill->SetReqLevel(3, 6); $skill->SetReqLevel(4, 10); Players::RegisterSkill(SKILL_NEGSKILLS, 5, 'negskills', 'Negotiation skills', SKILL_LUCK, 5); Players::RegisterSkill(SKILL_FARMING, 0, 'farming', 'Farming'); Players::RegisterSkill(SKILL_FISHING, 0, 'fishing', 'Fishing'); /* Create the upgrade menu */ $menu = new Menu(null, 'Upgrades', array('Players', 'menuUpgradesEnter'), array('Players', 'menuUpgradesExit'), 1, new Position(50, 120), 150); foreach (Players::$skills as $skill) { if ($skill->flag < SKILL_MAXUPGRADE) { $menu->Add($skill->name, 0, ROW_ACTION, array('Players', 'menuUpgradesSelect')); } } Players::$upgrade_menu = $menu; /* Create the upgrade textdraws list */ Players::$upgrade_draws = array_fill(0, MAX_PLAYERS, null); /* Register timers, callbacks and commands */ AddTimer(array('Players', 'Update'), 500, 1); AddTimer(array('Players', 'Stream'), 800, 1); Callbacks::Instance()->Register(cOnPlayerConnect, null, array('Players', 'OnPlayerConnect'), 0); Callbacks::Instance()->Register(cOnPlayerDisconnect, null, array('Players', 'OnPlayerDisconnect'), 5); Callbacks::Instance()->Register(cOnPlayerDeath, null, array('Players', 'OnPlayerDeath')); Callbacks::Instance()->Register(cOnPlayerSpawn, null, array('Players', 'OnPlayerSpawn')); Callbacks::Instance()->Register(cOnPlayerRequestClass, null, array('Players', 'OnPlayerRequestClass'), -1000); Callbacks::Instance()->Register(cOnPlayerRequestSpawn, null, array('Players', 'OnPlayerRequestSpawn')); Callbacks::Instance()->Register(cOnPlayerEnterVehicle, null, array('Players', 'OnPlayerEnterVehicle'), -1000); Callbacks::Instance()->Register(cOnPlayerKeyStateChange, null, array('Players', 'OnPlayerKeyStatechange')); CommandHandler::Register('togjq', 0, null, array('Players', 'cmdTogjq'), '', 1, -1000); CommandHandler::Register('togooc', 0, null, array('Players', 'cmdTogooc'), '', 1, -1000); CommandHandler::Register('die', 0, null, array('Players', 'cmdDie'), '', 1, -1000); CommandHandler::Register('stats', 0, null, array('Players', 'cmdStats'), '', 1, -1000); CommandHandler::Register('pay', 2, null, array('Players', 'cmdPay'), '[ID] [amount]', 1, -1000); CommandHandler::Register('skills', 0, null, array('Players', 'cmdSkills'), '', 1, -1000); CommandHandler::Register('upgrade', 0, null, array('Players', 'cmdUpgrade'), '', 1, -1000); CommandHandler::Register('speedometer', 1, null, array('Players', 'cmdSpeedometer'), '[kmh/mph]', 1, -1000); CommandHandler::Register('autowalk', 0, null, array('Players', 'cmdAutoWalk'), '', 1, -1000); Players::$players_by_id = array_fill(0, MAX_PLAYERS, null); /* Create the incar textdraws */ for ($i = 0; $i < MAX_PLAYERS; $i++) { Players::$incar_draws[$i] = TextDrawCreate(549.0, 393.0, '.'); TextDrawUseBox(Players::$incar_draws[$i], 1); TextDrawBoxColor(Players::$incar_draws[$i], 0x66); TextDrawTextSize(Players::$incar_draws[$i], 627.0, -10.0); TextDrawAlignment(Players::$incar_draws[$i], 0); TextDrawBackgroundColor(Players::$incar_draws[$i], 0xff); TextDrawFont(Players::$incar_draws[$i], 1); TextDrawLetterSize(Players::$incar_draws[$i], 0.499999, 1.1); TextDrawColor(Players::$incar_draws[$i], 0xffffffff); TextDrawSetOutline(Players::$incar_draws[$i], 1); TextDrawSetProportional(Players::$incar_draws[$i], 1); TextDrawSetShadow(Players::$incar_draws[$i], 1); TextDrawHideForAll(Players::$incar_draws[$i]); } }
public static function Register($name, Animation $animation) { Animations::$stdanims[strtolower($name)] = $animation; CommandHandler::Register($name, 0, null, array('Animations', 'cmdStdanims'), '', 1, -1000); }
function testinit() { CommandHandler::Register('myping', 0, null, 'domyping', '', 1); CommandHandler::Register('cash', 0, null, 'testcash', '', 1); CommandHandler::Register('delv', 1, null, 'testdelv', '[vehicle id]', 1); CommandHandler::Register('main', 0, null, 'testmain', '', 1); CommandHandler::Register('buyarmor', 0, null, 'buyarmor', '', 1); CommandHandler::Register('cw', 0, null, 'cw', '', 1); CommandHandler::Register('gotoz', 1, null, 'gotoz', '', 1); CommandHandler::Register('freeze', 1, null, 'freeze', '', 1); CommandHandler::Register('unfreeze', 1, null, 'unfreeze', '', 1); CommandHandler::Register('anim', 2, null, 'doanim', '', 1); CommandHandler::Register('stopanim', 0, null, 'dostopanim', '', 1); CommandHandler::Register('jetpack', 0, null, 'dojetpack', '', 1); CommandHandler::Register('gotoxyz', 3, null, 'dogotoxyz', 'x y z', 1); CommandHandler::Register('savedata', 0, null, 'dosavedata', '', 1); CommandHandler::Register('eject', 0, null, 'doeject', '', 1); CommandHandler::Register('freezebank', 2, null, 'dofreezebank', '[ID] [true/false]', 1); CommandHandler::Register('eat', 0, null, 'doeat', '', 1); CommandHandler::Register('drophouse', 0, null, 'drophouse', '', 1); CommandHandler::Register('bankcash', 0, null, 'dobankcash', '', 1); CommandHandler::Register('maketime', 1, null, 'domaketime', '[timeformat]', 1); CommandHandler::Register('cage', 0, null, 'docage', '', 1); CommandHandler::Register('unsync', 0, null, 'dounsync', '', 1); CommandHandler::Register('resync', 0, null, 'doresync', '', 1); CommandHandler::Register('givewep', 2, null, 'givewep', '[weapon] [ammo]', 1); CommandHandler::Register('getwep', 1, null, 'getwep', '[weapon]', 1); CommandHandler::Register('drivenext', 0, null, 'dodrivenext', '', 1); CommandHandler::Register('passengerof', 1, null, 'dopassengerof', '[ID]', 1); }
public static function Handle($playerid, $cmdtext) { $player = Players::FindByID($playerid); if ($player == null) { return 0; } // Log::Append(LOG_COMMAND, "[{$player->id}] {$player->name} -> {$cmdtext}"); $params = explode(' ', substr($cmdtext, 1)); $name = strtolower($params[0]); if (!isset(CommandHandler::$commands[$name])) { return 0; } $cmd = CommandHandler::$commands[$name]; if ($cmd->authed && (!$player->account || !$player->account->Authed())) { $player->Send(COLOR_RED, '* Login before sending this command'); return 1; } $numparams = count($params) - 1; if ($numparams < $cmd->numparams) { CommandHandler::SendUsage($player, $name, $cmd); } else { if (!$cmd->Call($player, $numparams, $params)) { CommandHandler::SendUsage($player, $name, $cmd); } } return 1; }
/** * @test * @expectedException \Apha\Annotations\ReadOnlyException */ public function setCommandTypeIsWriteOnce() { $annotation = new CommandHandler(); $annotation->setCommandType('bar'); $annotation->setCommandType('baz'); }
function OnPlayerCommandText($playerid, $cmdtext) { return CommandHandler::Handle($playerid, $cmdtext); }
/** * set sharekill of a transfer * * @param $transfer * @param $sharekill * @param $autosend * @return boolean */ function setSharekill($transfer, $sharekill, $autosend = false) { // set sharekill $this->sharekill = intval($sharekill); // recalc sharekill if ($this->_recalcSharekill() === false) { return false; } // add command CommandHandler::add($transfer, "s" . $this->sharekill_param); // send command to client if ($autosend) { CommandHandler::send($transfer); } // return return true; }
public static function Init() { Callbacks::Instance()->Register(cOnPlayerConnect, null, array('Accounts', 'OnPlayerConnect'), 5); Callbacks::Instance()->Register(cOnPlayerDisconnect, null, array('Accounts', 'OnPlayerDisconnect'), 0); CommandHandler::Register('login', 1, null, array('Accounts', 'cmdLogin'), '[password]', 0, -1000); }
public static function Init() { CommandHandler::Register('rolldown', 0, null, array('Vehicles', 'cmdRolldown'), '', 1); CommandHandler::Register('rollup', 0, null, array('Vehicles', 'cmdRollup'), '', 1); CommandHandler::Register('lockwindows', 0, null, array('Vehicles', 'cmdLockwindows'), '', 1); CommandHandler::Register('unlockwindows', 0, null, array('Vehicles', 'cmdUnlockwindows'), '', 1); CommandHandler::Register('makecar', 1, null, array('Vehicles', 'cmdCreateVehicle'), '[VehicleID/VehicleName]', 1); Keybinds::Register(array(KEY_LOOK_LEFT, KEY_LOOK_LEFT), null, array('Vehicles', 'RolldownupKeybind')); Vehicles::$vehicles = array_fill(0, 700, null); echo ">>>>> Categorizing vehicle models ...\n"; for ($i = 0; $i < 400; $i++) { Vehicles::Describe($i, new VehicleAttributes(null)); } /* model name trunk size deposit size flags */ Vehicles::Describe(400, new VehicleAttributes('Landstalker', 4000, 50, VEHICLE_CAR | VEHICLE_ROLLABLE | VEHICLE_MODDABLE)); Vehicles::Describe(401, new VehicleAttributes('Bravura', 3000, 30, VEHICLE_CAR | VEHICLE_ROLLABLE | VEHICLE_MODDABLE)); Vehicles::Describe(402, new VehicleAttributes('Buffalo', 2000, 50, VEHICLE_CAR | VEHICLE_ROLLABLE)); Vehicles::Describe(403, new VehicleAttributes('Linerunner', 0, 60, VEHICLE_TRUCK | VEHICLE_ROLLABLE)); Vehicles::Describe(404, new VehicleAttributes('Perenniel', 5000, 25, VEHICLE_CAR | VEHICLE_ROLLABLE | VEHICLE_MODDABLE)); Vehicles::Describe(405, new VehicleAttributes('Sentinel', 5000, 40, VEHICLE_CAR | VEHICLE_ROLLABLE | VEHICLE_MODDABLE)); Vehicles::Describe(406, new VehicleAttributes('Dumper', 22000, 90, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(407, new VehicleAttributes('Fire truck', 0, 50, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(408, new VehicleAttributes('Trashmaster', 0, 40, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(409, new VehicleAttributes('Stretch', 3000, 55, VEHICLE_CAR | VEHICLE_ROLLABLE)); Vehicles::Describe(410, new VehicleAttributes('Manana', 3000, 30, VEHICLE_CAR | VEHICLE_ROLLABLE | VEHICLE_MODDABLE)); Vehicles::Describe(411, new VehicleAttributes('Infernus', 3000, 85, VEHICLE_CAR | VEHICLE_ROLLABLE)); Vehicles::Describe(412, new VehicleAttributes('Voodoo', 6000, 40, VEHICLE_CAR | VEHICLE_ROLLABLE)); Vehicles::Describe(413, new VehicleAttributes('Pony', 12000, 45, VEHICLE_VAN | VEHICLE_ROLLABLE)); Vehicles::Describe(414, new VehicleAttributes('Mule', 18000, 50, VEHICLE_VAN | VEHICLE_ROLLABLE)); Vehicles::Describe(415, new VehicleAttributes('Cheetah', 2000, 85, VEHICLE_CAR | VEHICLE_ROLLABLE | VEHICLE_MODDABLE)); Vehicles::Describe(416, new VehicleAttributes('Ambulance', 0, 25, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(417, new VehicleAttributes('Leviathan', 0, 100, VEHICLE_PLANE | VEHICLE_WINDOWS)); Vehicles::Describe(418, new VehicleAttributes('Moonbeam', 6000, 35, VEHICLE_CAR | VEHICLE_ROLLABLE | VEHICLE_MODDABLE)); Vehicles::Describe(419, new VehicleAttributes('Esperanto', 4000, 40, VEHICLE_CAR | VEHICLE_ROLLABLE)); Vehicles::Describe(420, new VehicleAttributes('Taxi', 0, 20, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(421, new VehicleAttributes('Washington', 4000, 45, VEHICLE_CAR | VEHICLE_ROLLABLE | VEHICLE_MODDABLE)); Vehicles::Describe(422, new VehicleAttributes('Bobcat', 8000, 40, VEHICLE_CAR | VEHICLE_ROLLABLE | VEHICLE_MODDABLE)); Vehicles::Describe(423, new VehicleAttributes('Mr Whoopee', 0, 30, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(424, new VehicleAttributes('BF Injection', 2000, 40, VEHICLE_OTHERS)); Vehicles::Describe(425, new VehicleAttributes('Hunter', 0, 120, VEHICLE_PLANE | VEHICLE_WINDOWS)); Vehicles::Describe(426, new VehicleAttributes('Premier', 3000, 35, VEHICLE_CAR | VEHICLE_ROLLABLE | VEHICLE_MODDABLE)); Vehicles::Describe(427, new VehicleAttributes('Enforcer', 0, 30, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(428, new VehicleAttributes('Securicar', 12000, 60, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(429, new VehicleAttributes('Banshee', 2000, 80, VEHICLE_CAR | VEHICLE_ROLLABLE)); Vehicles::Describe(430, new VehicleAttributes('Predator', 0, 50, VEHICLE_BOAT)); Vehicles::Describe(431, new VehicleAttributes('Bus', 0, 25, VEHICLE_OTHERS | VEHICLE_WINDOWS)); Vehicles::Describe(432, new VehicleAttributes('Rhino', 0, 80, VEHICLE_OTHERS | VEHICLE_WINDOWS)); Vehicles::Describe(433, new VehicleAttributes('Barracks', 0, 60, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(434, new VehicleAttributes('Hotknife', 2000, 50, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(435, new VehicleAttributes('Article1', 30000, 0, VEHICLE_TRAILER)); Vehicles::Describe(436, new VehicleAttributes('Previon', 4000, 35, VEHICLE_CAR | VEHICLE_ROLLABLE | VEHICLE_MODDABLE)); Vehicles::Describe(437, new VehicleAttributes('Coach', 0, 25, VEHICLE_OTHERS | VEHICLE_WINDOWS)); Vehicles::Describe(438, new VehicleAttributes('Cabbie', 0, 25, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(439, new VehicleAttributes('Stallion', 2000, 70, VEHICLE_CAR | VEHICLE_ROLLABLE | VEHICLE_MODDABLE)); Vehicles::Describe(440, new VehicleAttributes('Rumpo', 12000, 40, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(441, new VehicleAttributes('RC Bandit', 0, 0, VEHICLE_OTHERS)); Vehicles::Describe(442, new VehicleAttributes('Romero', 0, 40, VEHICLE_CAR | VEHICLE_ROLLABLE)); Vehicles::Describe(443, new VehicleAttributes('Packet', 0, 60, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(444, new VehicleAttributes('Monster', 0, 65, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(445, new VehicleAttributes('Admiral', 3000, 35, VEHICLE_CAR | VEHICLE_ROLLABLE)); Vehicles::Describe(446, new VehicleAttributes('Squallo', 10000, 60, VEHICLE_BOAT)); Vehicles::Describe(447, new VehicleAttributes('Sea sparrow', 0, 80, VEHICLE_PLANE | VEHICLE_WINDOWS)); Vehicles::Describe(448, new VehicleAttributes('Pizza boy', 0, 15, VEHICLE_BIKE)); Vehicles::Describe(449, new VehicleAttributes('Tram', 0, 0, VEHICLE_TRAIN | VEHICLE_WINDOWS)); Vehicles::Describe(450, new VehicleAttributes('Article2', 30000, 0, VEHICLE_TRAILER)); Vehicles::Describe(451, new VehicleAttributes('Turismo', 2000, 85, VEHICLE_CAR | VEHICLE_ROLLABLE)); Vehicles::Describe(452, new VehicleAttributes('Speeder', 4000, 60, VEHICLE_BOAT)); Vehicles::Describe(453, new VehicleAttributes('Reefer', 12000, 50, VEHICLE_BOAT)); Vehicles::Describe(454, new VehicleAttributes('Tropic', 15000, 50, VEHICLE_BOAT)); Vehicles::Describe(455, new VehicleAttributes('Flatbed', 22000, 80, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(456, new VehicleAttributes('Yankee', 20000, 75, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(457, new VehicleAttributes('Caddy', 0, 15, VEHICLE_OTHERS)); Vehicles::Describe(458, new VehicleAttributes('Solair', 4000, 35, VEHICLE_CAR | VEHICLE_ROLLABLE)); Vehicles::Describe(459, new VehicleAttributes('Topfun', 12000, 45, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(460, new VehicleAttributes('Skimmer', 0, 40, VEHICLE_PLANE | VEHICLE_WINDOWS)); Vehicles::Describe(461, new VehicleAttributes('PCJ-600', 0, 20, VEHICLE_BIKE)); Vehicles::Describe(462, new VehicleAttributes('Faggio', 0, 15, VEHICLE_BIKE)); Vehicles::Describe(463, new VehicleAttributes('Freeway', 0, 35, VEHICLE_BIKE)); Vehicles::Describe(464, new VehicleAttributes('RC Baron', 0, 0, VEHICLE_OTHERS)); Vehicles::Describe(465, new VehicleAttributes('RC Raider', 0, 0, VEHICLE_OTHERS)); Vehicles::Describe(466, new VehicleAttributes('Glendale', 3000, 45, VEHICLE_CAR | VEHICLE_ROLLABLE)); Vehicles::Describe(467, new VehicleAttributes('Oceanic', 3000, 47, VEHICLE_CAR | VEHICLE_ROLLABLE)); Vehicles::Describe(468, new VehicleAttributes('Sanchez', 0, 15, VEHICLE_BIKE)); Vehicles::Describe(469, new VehicleAttributes('Sparrow', 0, 35, VEHICLE_PLANE | VEHICLE_WINDOWS)); Vehicles::Describe(470, new VehicleAttributes('Patriot', 2000, 50, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(471, new VehicleAttributes('Quad', 0, 25, VEHICLE_BIKE)); Vehicles::Describe(472, new VehicleAttributes('Coastguard', 2000, 25, VEHICLE_BOAT)); Vehicles::Describe(473, new VehicleAttributes('Dinghy', 0, 15, VEHICLE_BOAT)); Vehicles::Describe(474, new VehicleAttributes('Hermes', 4000, 55, VEHICLE_CAR | VEHICLE_ROLLABLE)); Vehicles::Describe(475, new VehicleAttributes('Sabre', 3000, 65, VEHICLE_CAR | VEHICLE_ROLLABLE)); Vehicles::Describe(476, new VehicleAttributes('Rustler', 0, 75, VEHICLE_PLANE | VEHICLE_WINDOWS)); Vehicles::Describe(477, new VehicleAttributes('ZR-350', 2000, 70, VEHICLE_CAR | VEHICLE_ROLLABLE | VEHICLE_MODDABLE)); Vehicles::Describe(478, new VehicleAttributes('Walton', 8000, 50, VEHICLE_CAR | VEHICLE_ROLLABLE | VEHICLE_MODDABLE)); Vehicles::Describe(479, new VehicleAttributes('Regina', 4000, 40, VEHICLE_CAR | VEHICLE_ROLLABLE)); Vehicles::Describe(480, new VehicleAttributes('Comet', 2000, 65, VEHICLE_CAR)); Vehicles::Describe(481, new VehicleAttributes('BMX', 0, 0, VEHICLE_BICYCLE)); Vehicles::Describe(482, new VehicleAttributes('Burrito', 12000, 50, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(483, new VehicleAttributes('Camper', 6000, 40, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(484, new VehicleAttributes('Marquis', 18000, 25, VEHICLE_BOAT)); Vehicles::Describe(485, new VehicleAttributes('Baggage', 0, 15, VEHICLE_OTHERS)); Vehicles::Describe(486, new VehicleAttributes('Dozer', 18000, 60, VEHICLE_OTHERS)); Vehicles::Describe(487, new VehicleAttributes('Maverick', 0, 90, VEHICLE_PLANE | VEHICLE_WINDOWS)); Vehicles::Describe(488, new VehicleAttributes('News Maverick', 0, 90, VEHICLE_PLANE | VEHICLE_WINDOWS)); Vehicles::Describe(489, new VehicleAttributes('Rancher', 6000, 55, VEHICLE_CAR | VEHICLE_ROLLABLE | VEHICLE_MODDABLE)); Vehicles::Describe(490, new VehicleAttributes('FBI Rancher', 0, 55, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(491, new VehicleAttributes('Virgo', 3000, 35, VEHICLE_CAR | VEHICLE_ROLLABLE | VEHICLE_MODDABLE)); Vehicles::Describe(492, new VehicleAttributes('Greenwood', 3000, 35, VEHICLE_CAR | VEHICLE_ROLLABLE | VEHICLE_MODDABLE)); Vehicles::Describe(493, new VehicleAttributes('Jetmax', 5000, 60, VEHICLE_BOAT)); Vehicles::Describe(494, new VehicleAttributes('Hotring C', 0, 80, VEHICLE_OTHERS)); Vehicles::Describe(495, new VehicleAttributes('Sandking', 6000, 80, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(496, new VehicleAttributes('Blista', 3000, 25, VEHICLE_CAR | VEHICLE_ROLLABLE | VEHICLE_MODDABLE)); Vehicles::Describe(497, new VehicleAttributes('Police Maverick', 0, 40, VEHICLE_PLANE | VEHICLE_WINDOWS)); Vehicles::Describe(498, new VehicleAttributes('Boxville', 18000, 60, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(499, new VehicleAttributes('Benson', 19000, 60, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(500, new VehicleAttributes('Mesa', 2000, 40, VEHICLE_CAR)); Vehicles::Describe(501, new VehicleAttributes('RC Goblin', 0, 0, VEHICLE_OTHERS)); Vehicles::Describe(502, new VehicleAttributes('Hotring A', 4000, 80, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(503, new VehicleAttributes('Hotring B', 4000, 80, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(504, new VehicleAttributes('Bloodra', 5000, 70, VEHICLE_OTHERS)); Vehicles::Describe(505, new VehicleAttributes('Rancher', 8000, 50, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(506, new VehicleAttributes('Super GT', 2000, 85, VEHICLE_CAR | VEHICLE_ROLLABLE)); Vehicles::Describe(507, new VehicleAttributes('Elegant', 6000, 55, VEHICLE_CAR | VEHICLE_ROLLABLE)); Vehicles::Describe(508, new VehicleAttributes('Camper', 0, 40, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(509, new VehicleAttributes('Bike', 0, 0, VEHICLE_BICYCLE)); Vehicles::Describe(510, new VehicleAttributes('Mountain Bike', 0, 0, VEHICLE_BICYCLE)); Vehicles::Describe(511, new VehicleAttributes('Beagle', 0, 80, VEHICLE_PLANE | VEHICLE_WINDOWS)); Vehicles::Describe(512, new VehicleAttributes('Cropduster', 0, 75, VEHICLE_PLANE | VEHICLE_WINDOWS)); Vehicles::Describe(513, new VehicleAttributes('Stunt plane', 0, 75, VEHICLE_PLANE | VEHICLE_WINDOWS)); Vehicles::Describe(514, new VehicleAttributes('Petrol tanker', 0, 65, VEHICLE_TRUCK | VEHICLE_ROLLABLE)); Vehicles::Describe(515, new VehicleAttributes('Road train', 0, 70, VEHICLE_TRUCK | VEHICLE_ROLLABLE)); Vehicles::Describe(516, new VehicleAttributes('Nebula', 4000, 40, VEHICLE_CAR | VEHICLE_ROLLABLE | VEHICLE_MODDABLE)); Vehicles::Describe(517, new VehicleAttributes('Majestic', 6000, 45, VEHICLE_CAR | VEHICLE_ROLLABLE | VEHICLE_MODDABLE)); Vehicles::Describe(518, new VehicleAttributes('Buccaneer', 4000, 40, VEHICLE_CAR | VEHICLE_ROLLABLE | VEHICLE_MODDABLE)); Vehicles::Describe(519, new VehicleAttributes('Shamal', 0, 400, VEHICLE_PLANE | VEHICLE_WINDOWS)); Vehicles::Describe(520, new VehicleAttributes('Hydra', 0, 600, VEHICLE_PLANE | VEHICLE_WINDOWS)); Vehicles::Describe(521, new VehicleAttributes('FCR 900', 0, 25, VEHICLE_BIKE)); Vehicles::Describe(522, new VehicleAttributes('NRG 500', 0, 30, VEHICLE_BIKE)); Vehicles::Describe(523, new VehicleAttributes('Cop bike', 0, 20, VEHICLE_BIKE)); Vehicles::Describe(524, new VehicleAttributes('Cement truck', 0, 40, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(525, new VehicleAttributes('Tow truck', 0, 30, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(526, new VehicleAttributes('Fortune', 3000, 40, VEHICLE_CAR | VEHICLE_ROLLABLE)); Vehicles::Describe(527, new VehicleAttributes('Cadrona', 3000, 45, VEHICLE_CAR | VEHICLE_ROLLABLE | VEHICLE_MODDABLE)); Vehicles::Describe(528, new VehicleAttributes('FBI truck', 0, 40, VEHICLE_OTHERS | VEHICLE_WINDOWS)); Vehicles::Describe(529, new VehicleAttributes('Willard', 4000, 30, VEHICLE_CAR | VEHICLE_ROLLABLE | VEHICLE_MODDABLE)); Vehicles::Describe(530, new VehicleAttributes('Forklift', 0, 5, VEHICLE_OTHERS)); Vehicles::Describe(531, new VehicleAttributes('Tractor', 0, 15, VEHICLE_OTHERS)); Vehicles::Describe(532, new VehicleAttributes('Harvester', 0, 15, VEHICLE_OTHERS)); Vehicles::Describe(533, new VehicleAttributes('Feltzer', 6000, 45, VEHICLE_CAR)); Vehicles::Describe(534, new VehicleAttributes('Remington', 8000, 45, VEHICLE_CAR | VEHICLE_ROLLABLE | VEHICLE_LOWRIDER)); Vehicles::Describe(535, new VehicleAttributes('Slamvan', 8000, 50, VEHICLE_CAR | VEHICLE_ROLLABLE | VEHICLE_LOWRIDER)); Vehicles::Describe(536, new VehicleAttributes('Blade', 6000, 45, VEHICLE_CAR | VEHICLE_LOWRIDER)); Vehicles::Describe(537, new VehicleAttributes('Freight', 0, 0, VEHICLE_TRAIN | VEHICLE_WINDOWS)); Vehicles::Describe(538, new VehicleAttributes('Browstreak', 0, 0, VEHICLE_TRAIN | VEHICLE_WINDOWS)); Vehicles::Describe(539, new VehicleAttributes('Vortex', 0, 30, VEHICLE_OTHERS)); Vehicles::Describe(540, new VehicleAttributes('Vincent', 3000, 35, VEHICLE_CAR | VEHICLE_ROLLABLE | VEHICLE_MODDABLE)); Vehicles::Describe(541, new VehicleAttributes('Bullet', 2000, 85, VEHICLE_CAR | VEHICLE_ROLLABLE)); Vehicles::Describe(542, new VehicleAttributes('Clover', 4000, 45, VEHICLE_CAR | VEHICLE_ROLLABLE | VEHICLE_MODDABLE)); Vehicles::Describe(543, new VehicleAttributes('Sadler', 10000, 50, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(544, new VehicleAttributes('Fire truck 2', 0, 50, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(545, new VehicleAttributes('Hustler', 4000, 25, VEHICLE_CAR | VEHICLE_ROLLABLE)); Vehicles::Describe(546, new VehicleAttributes('Intruder', 3000, 40, VEHICLE_CAR | VEHICLE_ROLLABLE | VEHICLE_MODDABLE)); Vehicles::Describe(547, new VehicleAttributes('Primo', 3000, 40, VEHICLE_CAR | VEHICLE_ROLLABLE | VEHICLE_MODDABLE)); Vehicles::Describe(548, new VehicleAttributes('Cargobob', 0, 90, VEHICLE_PLANE | VEHICLE_WINDOWS)); Vehicles::Describe(549, new VehicleAttributes('Tampa', 3000, 65, VEHICLE_CAR | VEHICLE_ROLLABLE | VEHICLE_MODDABLE)); Vehicles::Describe(550, new VehicleAttributes('Sunrise', 3000, 45, VEHICLE_CAR | VEHICLE_ROLLABLE | VEHICLE_MODDABLE)); Vehicles::Describe(551, new VehicleAttributes('Merit', 3000, 45, VEHICLE_CAR | VEHICLE_ROLLABLE | VEHICLE_MODDABLE)); Vehicles::Describe(552, new VehicleAttributes('Utility Van', 3000, 60, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(553, new VehicleAttributes('Nevada', 0, 200, VEHICLE_PLANE | VEHICLE_WINDOWS)); Vehicles::Describe(554, new VehicleAttributes('Yosemite', 8000, 65, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(555, new VehicleAttributes('Windsor', 2000, 55, VEHICLE_CAR)); Vehicles::Describe(556, new VehicleAttributes('Monster A', 12000, 90, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(557, new VehicleAttributes('Monster B', 12000, 90, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(558, new VehicleAttributes('Uranus', 3000, 65, VEHICLE_CAR | VEHICLE_ARCHANG | VEHICLE_ROLLABLE)); Vehicles::Describe(559, new VehicleAttributes('Jester', 3000, 70, VEHICLE_CAR | VEHICLE_ARCHANG | VEHICLE_ROLLABLE)); Vehicles::Describe(560, new VehicleAttributes('Sultan', 3000, 70, VEHICLE_CAR | VEHICLE_ARCHANG | VEHICLE_ROLLABLE)); Vehicles::Describe(561, new VehicleAttributes('Stratum', 4000, 45, VEHICLE_CAR | VEHICLE_ARCHANG | VEHICLE_ROLLABLE)); Vehicles::Describe(562, new VehicleAttributes('Elegy', 3000, 75, VEHICLE_CAR | VEHICLE_ARCHANG | VEHICLE_ROLLABLE)); Vehicles::Describe(563, new VehicleAttributes('Raindance', 0, 120, VEHICLE_PLANE | VEHICLE_WINDOWS)); Vehicles::Describe(564, new VehicleAttributes('RC Tiger', 0, 0, VEHICLE_OTHERS)); //special Vehicles::Describe(565, new VehicleAttributes('Flash', 4000, 40, VEHICLE_CAR | VEHICLE_ARCHANG | VEHICLE_ROLLABLE)); Vehicles::Describe(566, new VehicleAttributes('Tahoma', 5000, 60, VEHICLE_CAR | VEHICLE_LOWRIDER | VEHICLE_ROLLABLE)); Vehicles::Describe(567, new VehicleAttributes('Savanna', 5000, 60, VEHICLE_CAR | VEHICLE_LOWRIDER | VEHICLE_ROLLABLE)); Vehicles::Describe(568, new VehicleAttributes('Bandito', 0, 25, VEHICLE_OTHERS)); Vehicles::Describe(569, new VehicleAttributes('Freight Flat', 45000, 0, VEHICLE_TRAILER)); Vehicles::Describe(570, new VehicleAttributes('Streak', 0, 0, VEHICLE_TRAILER | VEHICLE_WINDOWS)); Vehicles::Describe(571, new VehicleAttributes('Kart', 0, 15, VEHICLE_OTHERS)); Vehicles::Describe(572, new VehicleAttributes('Mower', 0, 70, VEHICLE_OTHERS)); Vehicles::Describe(573, new VehicleAttributes('Dune', 15000, 50, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(574, new VehicleAttributes('Sweeper', 0, 35, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(575, new VehicleAttributes('Broadway', 3000, 55, VEHICLE_CAR | VEHICLE_LOWRIDER | VEHICLE_ROLLABLE)); Vehicles::Describe(576, new VehicleAttributes('Tornado', 3000, 55, VEHICLE_CAR | VEHICLE_LOWRIDER | VEHICLE_ROLLABLE)); Vehicles::Describe(577, new VehicleAttributes('AT 400', 0, 1000, VEHICLE_PLANE | VEHICLE_WINDOWS)); Vehicles::Describe(578, new VehicleAttributes('DFT-30', 18000, 65, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(579, new VehicleAttributes('Huntley', 4000, 60, VEHICLE_CAR | VEHICLE_ROLLABLE)); Vehicles::Describe(580, new VehicleAttributes('Stafford', 3000, 50, VEHICLE_CAR | VEHICLE_ROLLABLE | VEHICLE_MODDABLE)); Vehicles::Describe(581, new VehicleAttributes('BF-400', 0, 30, VEHICLE_BIKE)); Vehicles::Describe(582, new VehicleAttributes('Newsvan', 11000, 48, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(583, new VehicleAttributes('Tug', 0, 25, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(584, new VehicleAttributes('Petrol', 30000, 0, VEHICLE_TRAILER)); Vehicles::Describe(585, new VehicleAttributes('Emperor', 3000, 35, VEHICLE_CAR | VEHICLE_ROLLABLE | VEHICLE_MODDABLE)); Vehicles::Describe(586, new VehicleAttributes('Wayfarer', 0, 25, VEHICLE_BIKE)); Vehicles::Describe(587, new VehicleAttributes('Euros', 2000, 75, VEHICLE_CAR | VEHICLE_ARCHANG | VEHICLE_ROLLABLE)); Vehicles::Describe(588, new VehicleAttributes('Hotdog', 0, 40, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(589, new VehicleAttributes('Club', 3000, 35, VEHICLE_CAR | VEHICLE_ROLLABLE | VEHICLE_MODDABLE)); Vehicles::Describe(590, new VehicleAttributes('Freight Box', 48000, 0, VEHICLE_TRAILER)); Vehicles::Describe(591, new VehicleAttributes('Article 3', 30000, 0, VEHICLE_TRAILER)); Vehicles::Describe(592, new VehicleAttributes('Andromada', 0, 800, VEHICLE_PLANE | VEHICLE_WINDOWS)); Vehicles::Describe(593, new VehicleAttributes('Dodo', 0, 90, VEHICLE_PLANE | VEHICLE_WINDOWS)); Vehicles::Describe(594, new VehicleAttributes('RC Cam', 0, 0, VEHICLE_OTHERS)); //special Vehicles::Describe(595, new VehicleAttributes('Launch', 8000, 60, VEHICLE_BOAT)); Vehicles::Describe(596, new VehicleAttributes('Police Car', 3000, 50, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(597, new VehicleAttributes('Police Car', 3000, 50, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(598, new VehicleAttributes('Police Car', 3000, 50, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(599, new VehicleAttributes('Police Ranger', 6000, 60, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(600, new VehicleAttributes('Picador', 8000, 55, VEHICLE_CAR | VEHICLE_ROLLABLE | VEHICLE_MODDABLE)); Vehicles::Describe(601, new VehicleAttributes('S.W.A.T.', 0, 60, VEHICLE_OTHERS | VEHICLE_WINDOWS)); Vehicles::Describe(602, new VehicleAttributes('Alpha', 3000, 65, VEHICLE_CAR | VEHICLE_ROLLABLE)); Vehicles::Describe(603, new VehicleAttributes('Phoenix', 3000, 70, VEHICLE_CAR | VEHICLE_ROLLABLE | VEHICLE_MODDABLE)); Vehicles::Describe(604, new VehicleAttributes('Glendale S', 3000, 45, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(605, new VehicleAttributes('Sadler S', 8000, 55, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(606, new VehicleAttributes('Baggage A', 8000, 0, VEHICLE_TRAILER)); Vehicles::Describe(607, new VehicleAttributes('Baggage B', 6000, 0, VEHICLE_TRAILER)); Vehicles::Describe(608, new VehicleAttributes('Tug Stairs', 0, 0, VEHICLE_TRAILER)); Vehicles::Describe(609, new VehicleAttributes('Boxburg', 18000, 65, VEHICLE_OTHERS | VEHICLE_ROLLABLE)); Vehicles::Describe(610, new VehicleAttributes('Farm', 0, 0, VEHICLE_TRAILER)); Vehicles::Describe(611, new VehicleAttributes('Utility', 0, 0, VEHICLE_TRAILER)); /* Now it's 01:53 and I only want to say: "F**k you Ryden!" -- Crazy <-- quote --- red */ VehicleShop::Init(); }
/** * deletes a transfer * * @return boolean */ function _delete() { global $cfg; // delete if ($cfg["user"] == $this->owner || $cfg['isAdmin']) { // XFER: before deletion save upload/download xfer data to SQL if ($cfg['enable_xfer'] == 1) { $transferTotals = $this->getTransferCurrent($this->transfer); Xfer::save($this->owner, $transferTotals["downtotal"], $transferTotals["uptotal"]); } // update totals $this->_updateTotals(); // remove settings from db deleteTransferSettings($this->transfer); // client-cache $this->deleteCache($this->transfer); // command-clean CommandHandler::clean($this->transfer); // remove meta-file if (@file_exists($this->transferFilePath)) { @unlink($this->transferFilePath); } // remove stat-file if (@file_exists($this->transferFilePath . ".stat")) { @unlink($this->transferFilePath . ".stat"); } // if exist remove pid file if (@file_exists($this->transferFilePath . ".pid")) { @unlink($this->transferFilePath . ".pid"); } // if exist remove log-file if (@file_exists($this->transferFilePath . ".log")) { @unlink($this->transferFilePath . ".log"); } // if exist remove prio-file if (@file_exists($this->transferFilePath . ".prio")) { @unlink($this->transferFilePath . ".prio"); } AuditAction($cfg["constants"]["delete_transfer"], $this->transfer); return true; } else { AuditAction($cfg["constants"]["error"], "ILLEGAL DELETE: " . $this->transfer); return false; } }