From 3cd733501939abd70f522b9f0dbd3c729f0b5812 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Thu, 10 Feb 2022 17:58:08 -0600 Subject: [PATCH] Cleanup old job scripts --- scripts/server/job/bus.js | 436 +-------------------------- scripts/server/job/garbage.js | 150 --------- scripts/server/job/pizza-delivery.js | 252 ---------------- scripts/server/job/police.js | 244 --------------- 4 files changed, 1 insertion(+), 1081 deletions(-) diff --git a/scripts/server/job/bus.js b/scripts/server/job/bus.js index 523fa55b..44803788 100644 --- a/scripts/server/job/bus.js +++ b/scripts/server/job/bus.js @@ -9,439 +9,5 @@ // Routes are divided up per-island. Smaller islands will have less routes. // Routes will attempt to cross over into other routes whenever possible, creating transfer stops. +// All routes will start and stop at the same transit station, creating a central hub for all routes // Routes are identified by island name and colour. Example: Portland Red Line or Los Santos Blue Line - -let busRoutes = [ - false, - - [ // GTA 3 (1) - [ // PORTLAND ISLAND (0) - { // RED ROUTE (0) - name: "Portland Red Line", - island: 0, - busColour: 3, - payout: 175, - positions: [ - toVector3(1269, -1056.4, 14.75), - toVector3(1088.7, -968.8, 14.91), - toVector3(1059.1, -870.9, 14.91), - toVector3(917.6, -815.9, 14.91), - toVector3(851.1, -766.1, 14.91), - toVector3(838.8, -598.7, 14.91), - toVector3(959.3, -581.6, 14.91), - toVector3(853.1, -485.9, 14.91), - toVector3(838.8, -312.68, 6.8), - toVector3(913.9, -177.4, 4.91), - toVector3(1123.3, -67.74, 7.41), - toVector3(1043.6, -191.63, 4.91), - toVector3(1213.2, -281.3, 25.76), - toVector3(1193.3, -474.3, 24.98), - toVector3(1335.4, -499.7, 45.28), - toVector3(1220.3, -341.4, 26.38), - toVector3(1122.6, -475.6, 19.91), - toVector3(1309.2, -642.4, 12.3), - toVector3(1350.5, -845, 14.91), - toVector3(1322.2, -1025.3, 14.76), - toVector3(1307.5, -995.54, 14.88), - ], - }, - ], - - [ // STAUNTON ISLAND (1) - { // RED ROUTE (0) - name: "Staunton Red Line", - island: 1, - busColour: 3, - payout: 175, - positions: [ - toVector3(-1.11, -388.4, 16.11), - toVector3(-15.75, -735.3, 26.15), - toVector3(33.63, -1029.4, 26.11), - toVector3(-53.92, -1233.4, 26.11), - toVector3(126.58, -1323.7, 26.11), - toVector3(189.39, -1285.6, 26.11), - toVector3(266.9, -1179.1, 26.11), - toVector3(283.93, -1370.2, 26.11), - toVector3(144.44, -1455.5, 26.11), - toVector3(34.5, -1511.7, 26.11), - toVector3(325.31, -1579, 26.03), - toVector3(302.33, -1417.7, 26.11), - toVector3(309.76, -1290, 26.11), - toVector3(378.5, -1235.1, 26.11), - toVector3(404, -1376.3, 26.11), - toVector3(189.07, -1159.3, 26.11), - toVector3(189.44, -956.9, 26.11), - toVector3(254.18, -722.3, 26.11), - toVector3(383.4, -704.2, 26.11), - toVector3(429.3, -420.6, 22.04), - toVector3(570.9, -336.4, 19.71), - toVector3(267.46, 91.12, 15.96), - toVector3(99.13, -31.96, 16.11), - toVector3(243.94, -187.01, 21.31), - toVector3(99.17, -263.44, 16.11), - toVector3(-26.92, -283.73, 16.11), - ], - }, - ], - ], - - - [ // GTA VC - [ // WESTERN ISLAND (0) - { // RED ROUTE (0) - name: "Vice City Red Line", - island: 0, - busColour: 3, - payout: 100, - positions: [ - toVector3(-997.698, 175.8, 10.704), - toVector3(-607.007, 659.024, 10.9994), - toVector3(-665.23, 843.213, 11.3572), - toVector3(-669.703, 1174.17, 10.9954), - toVector3(19.0071, 967.446, 10.8685), - toVector3(-441.901, 1099.23, 10.9998), - toVector3(-1048.15, 1341.77, 8.76068), - toVector3(-870.697, 1049.45, 11.0081), - toVector3(-683.681, 610.935, 11.0217), - toVector3(-1011.02, 291.984, 11.3042), - toVector3(-1185.89, -264.69, 11.5162), - ], - }, - { // GREEN ROUTE (1) - name: "Vice City Green Line", - island: 0, - busColour: 46, - payout: 250, - positions: [ - toVector3(-1106.57, -300.12, 11.189), - toVector3(-1012.97, -372.445, 10.8688), - toVector3(-1018.07, -573.031, 11.0513), - toVector3(-1184.86, -647.271, 11.565), - toVector3(-1034.59, -908.376, 14.0954), - toVector3(-990.653, -1074.29, 14.7919), - toVector3(-1199.02, -946.758, 14.7914), - toVector3(-1431.57, -780.312, 14.7926), - toVector3(-1282.71, -785.966, 14.7917), - toVector3(-1204.48, -939.911, 14.7917), - toVector3(-1006.98, -1079.19, 14.7916), - toVector3(-928.565, -1257.33, 11.9578), - toVector3(-912.603, -1442.4, 11.8644), - toVector3(-683.223, -1389.97, 11.0019), - toVector3(-799.104, -1062.2, 11.0011), - toVector3(-812.002, -672.31, 11.0046), - toVector3(-834.03, -477.273, 11.0118), - toVector3(-840.406, -307.896, 11.0001), - toVector3(-829.729, -119.308, 11.0004), - toVector3(-903.957, 33.4505, 10.6344), - toVector3(-1002.04, -37.9656, 10.9094), - toVector3(-1066.83, -13.3146, 11.3389), - toVector3(-1067.5, 109.544, 11.3122), - toVector3(-1003.59, 171.078, 10.8953), - toVector3(-748.054, 198.243, 11.2455), - toVector3(-850, -110.625, 11.0203), - toVector3(-898.862, -280.373, 10.6645), - toVector3(-1082.1, -294.416, 11.2065), - ], - }, - ], - ], - - - [ // GTA SA - [ // LOS SANTOS ISLAND (0) - { // RED ROUTE (0) - /* - Serves: - * Southeastern Los Santos (Ganton, East Beach, Airport, Docks, Willowfield) - - Crossovers: - * Unity Station (Yellow, Blue, Green) - * Ganton (Green) - * Airport Gate (Yellow) - - Notable Stops: - * Docks - * Airport Gate - */ - name: "Los Santos Yellow Line", - island: 0, - busColour: 6, - payout: 200, - positions: [ - toVector3(1823.79, -1852.66, 13.5144), - toVector3(1804.12, -1609.59, 13.4419), - toVector3(1660.32, -1510.09, 13.4877), - toVector3(1612.54, -1322.23, 17.4085), - toVector3(1778.93, -1286.59, 13.5744), - toVector3(1854.72, -1208.16, 20.9552), - toVector3(1659.95, -1158.07, 23.8315), - toVector3(1461.6, -1031.05, 23.7518), - toVector3(1277.71, -1036.63, 31.6085), - toVector3(1322.74, -1151.38, 23.7558), - toVector3(1194.26, -1334.15, 13.4953), - toVector3(1081.29, -1392.64, 13.7023), - toVector3(1034.65, -1555.27, 13.4591), - toVector3(1033.26, -1782.3, 13.6323), - toVector3(1262.27, -1855, 13.4887), - toVector3(1445.39, -1875.5, 13.4944), - toVector3(1742.23, -2168.78, 13.557), - toVector3(1943.35, -2169.25, 13.4741), - toVector3(1963.51, -1969.6, 13.5867), - toVector3(1824.2, -1886.48, 13.4287), - ] - }, - { // BLUE ROUTE (1) - /* - Serves: - * Northwestern Los Santos (Vinewood, Temple, Market, Rodeo) - - Crossovers: - * Unity Station (Red, Yellow, Green) - * Skate Park (Yellow, Green) - * Glen Park (Yellow, Green) - * Alhambra Club (Yellow, Green) - * All Saints General Hospital (Yellow) - - Notable Stops: - * Madd Doggs Mansion - * All Saints General Hospital - * Market Ammunation - * Vinewood Blvd - * Vinewood Hills - * Santa Maria Beach/Pier - */ - name: "Los Santos Blue Line", - island: 0, - busColour: 2, - payout: 250, - positions: [ - toVector3(1824.17, -1851.5, 13.5134), - toVector3(1853.95, -1395.48, 13.4882), - toVector3(1659.33, -1158.59, 23.8368), - toVector3(1375.08, -1139.12, 23.7585), - toVector3(1186.53, -1139.9, 23.8007), - toVector3(1021.63, -1139.48, 23.7568), - toVector3(965.119, -1100.04, 23.7962), - toVector3(1058.53, -1042.64, 32.03), - toVector3(1238.74, -1041.7, 31.8307), - toVector3(1377.08, -977.352, 32.2744), - toVector3(1461.71, -731.011, 93.5068), - toVector3(1248.83, -729.438, 94.7962), - toVector3(932.221, -828.904, 94.6709), - toVector3(717.372, -982.938, 52.8477), - toVector3(452.042, -1182.3, 66.3269), - toVector3(287.664, -1221.08, 75.3682), - toVector3(225.497, -1346.85, 51.5658), - toVector3(438.728, -1720.92, 9.92785), - toVector3(894.789, -1788.3, 13.5674), - toVector3(919.419, -1592.92, 13.4843), - toVector3(939.902, -1408.49, 13.3463), - toVector3(1207.53, -1329.3, 13.5012), - toVector3(1324.24, -1282.88, 13.4815), - toVector3(1296.85, -1551.41, 13.4839), - toVector3(1294.85, -1811.15, 13.4816), - toVector3(1649.38, -1875.42, 13.4858), - toVector3(1819.59, -1870.9, 13.4987), - ] - }, - { // GREEN ROUTE (2) - /* - Serves: - * Northeastern Los Santos (Idlewood, Ganton, Jefferson, East Los Santos, East Beach) - - Crossovers: - * Unity Station (Red, Blue, Yellow) - * Skate Park (Blue, Yellow) - * Glen Park (Blue, Yellow) - * Ganton (Red) - * Alhambra Club (Yellow, Blue) - - Notable Stops: - * County General Hospital - * Glen Park - * Skate Park - * Stadium - */ - name: "Los Santos Green Line", - island: 0, - busColour: 86, - payout: 175, - positions: [ - toVector3(1823.94, -1853.88, 13.5103), - toVector3(1823.97, -1655.31, 13.4738), - toVector3(1854.81, -1409.54, 13.4829), - toVector3(1869.02, -1152.77, 23.8096), - toVector3(1975.68, -1104.29, 25.5835), - toVector3(2077.6, -985.15, 50.0375), - toVector3(2161.61, -1022.78, 62.5533), - toVector3(2173.38, -1148.91, 24.9203), - toVector3(2166.28, -1267.17, 23.9138), - toVector3(2087.27, -1298.99, 23.9193), - toVector3(2008.67, -1338.34, 23.9207), - toVector3(2026.04, -1468.12, 14.867), - toVector3(2108.83, -1684.64, 13.4771), - toVector3(2185.67, -1745.22, 13.4681), - toVector3(2287.18, -1734.76, 13.4821), - toVector3(2411.06, -1793.34, 13.4746), - toVector3(2451.02, -1934.86, 13.4209), - toVector3(2529.97, -1750.13, 13.479), - toVector3(2685.6, -1659.48, 11.4476), - toVector3(2739.7, -1524.93, 29.6406), - toVector3(2739.95, -1278.48, 57.8435), - toVector3(2683.93, -1068.66, 69.2199), - toVector3(2578.78, -1045.36, 69.5098), - toVector3(2326.9, -1128.69, 27.8126), - toVector3(2367.83, -1270.92, 23.941), - toVector3(2324.15, -1382.25, 23.9621), - toVector3(2137.14, -1382.12, 23.9376), - toVector3(2010.74, -1459.87, 13.4914), - toVector3(1824.35, -1562.74, 13.4622), - toVector3(1818.98, -1872.52, 13.5075), - ] - }, - { // YELLOW ROUTE (3) - /* - Serves: - * Central Los Santos (Downtown, Commerce, Market) - - Crossovers: - * Unity Station (Red, Blue, Green) - * Skate Park (Blue, Green) - * Glen Park (Blue, Green) - * All Saints General Hospital (Blue) - * Alhambra Club (Yellow, Blue) - * Airport Gate (Red) - - Notable Stops: - * All Saints General Hospital - * Bank - * Star Tower - * Airport Gate - */ - name: "Los Santos Red Line", - island: 0, - busColour: 3, - payout: 150, - positions: [ - toVector3(1823.79, -1852.66, 13.5144), - toVector3(1804.12, -1609.59, 13.4419), - toVector3(1660.32, -1510.09, 13.4877), - toVector3(1612.54, -1322.23, 17.4085), - toVector3(1778.93, -1286.59, 13.5744), - toVector3(1854.72, -1208.16, 20.9552), - toVector3(1659.95, -1158.07, 23.8315), - toVector3(1461.6, -1031.05, 23.7518), - toVector3(1277.71, -1036.63, 31.6085), - toVector3(1322.74, -1151.38, 23.7558), - toVector3(1194.26, -1334.15, 13.4953), - toVector3(1081.29, -1392.64, 13.7023), - toVector3(1034.65, -1555.27, 13.4591), - toVector3(1033.26, -1782.3, 13.6323), - toVector3(1262.27, -1855, 13.4887), - toVector3(1445.39, -1875.5, 13.4944), - toVector3(1742.23, -2168.78, 13.557), - toVector3(1943.35, -2169.25, 13.4741), - toVector3(1963.51, -1969.6, 13.5867), - toVector3(1824.2, -1886.48, 13.4287), - ] - } - ], - ], - - // GTA UG - [ - - ], - - // GTA IV - [ - - ], -]; - -// =========================================================================== - -function getRandomBusRoute(island) { - if(busRoutes[getServerGame()][island].length == 1) { - return 0; - } - return getRandom(0, busRoutes[getServerGame()][island].length-1); -} - -// =========================================================================== - -function getNextStopOnBusRoute(island, busRoute, busRouteStop) { - if(!isLastStopOnBusRoute(island, busRoute, busRouteStop)) { - return busRouteStop+1; - } else { - return busRoutes[getServerGame()][island][busRoute].positions.length-1; - } -} - -// =========================================================================== - -function isLastStopOnBusRoute(island, busRoute, busRouteStop) { - if(busRouteStop == busRoutes[getServerGame()][island][busRoute].positions.length-1) { - return true; - } - return false; -} - -// =========================================================================== - -function showNextBusStop(client) { - getPlayerData(client).jobRouteStop = getNextStopOnBusRoute(getPlayerData(client).jobRouteStop, getPlayerData(client).jobRoute, getPlayerData(client).jobRouteStop); - showCurrentBusStop(client); -} - -// =========================================================================== - -function showCurrentBusStop(client) { - sendJobRouteStopToPlayer(client, getBusRouteStopPosition(getPlayerIsland(client), getPlayerData(client).jobRoute, getPlayerData(client).jobRouteStop), getColourByName("busDriverGreen")) -} - -// =========================================================================== - -function playerArrivedAtBusStop(client) { - if(isLastStopOnBusRoute(getPlayerData(client).jobRouteIsland, getPlayerData(client).jobRoute, getPlayerData(client).jobRouteStop)) { - finishSuccessfulBusRoute(client); - return false; - } - - showGameMessage(client, "⌛ Please wait a moment for passengers to get on and off the bus.", getColourByName("busDriverGreen"), 3500); - freezeJobVehicleForRouteStop(client); - getPlayerData(client).jobRouteStop = getNextStopOnBusRoute(getPlayerData(client).jobRouteIsland, getPlayerData(client).jobRoute, getPlayerData(client).jobRouteStop); - setTimeout(function() { - unFreezeJobVehicleForRouteStop(client); - showCurrentBusStop(client); - showGameMessage(client, "Proceed to the next stop (green checkpoint)", getColourByName("busDriverGreen"), 3500); - }, 5000); -} - -// =========================================================================== - -function getBusRouteStopPosition(island, busRoute, busRouteStop) { - return busRoutes[getServerGame()][island][busRoute].positions[busRouteStop]; -} - -// =========================================================================== - -function getBusRouteData(island, busRoute) { - return busRoutes[getServerGame()][island][busRoute]; -} - -// =========================================================================== - -function finishSuccessfulBusRoute(client) { - respawnVehicle(getPlayerData(client).jobRouteVehicle); - let payout = toInteger(applyServerInflationMultiplier(getBusRouteData(getPlayerData(client).jobRouteIsland, getPlayerData(client).jobRoute).payout)); - getPlayerData(client).payDayAmount = getPlayerData(client).payDayAmount + payout; - messagePlayerNormal(client, `You finished the ${getBusRouteData(getPlayerData(client).jobRouteIsland, getPlayerData(client).jobRoute).name} bus route!. Your bus has been returned to the bus depot.`, getColourByName("yellow")); - messagePlayerNormal(client, `You earned {ALTCOLOUR}$${payout}{MAINCOLOUR}. Your total paycheck of {ALTCOLOUR}${getPlayerData(client).payDayAmount} {MAINCOLOUR}will be received next payday.`); - getPlayerData(client).jobRouteVehicle = false; - getPlayerData(client).jobRoute = 0; - getPlayerData(client).jobRouteStop = 0; - getPlayerData(client).jobRouteIsland = 0; -} - -// =========================================================================== \ No newline at end of file diff --git a/scripts/server/job/garbage.js b/scripts/server/job/garbage.js index cda21555..4971e7aa 100644 --- a/scripts/server/job/garbage.js +++ b/scripts/server/job/garbage.js @@ -6,153 +6,3 @@ // DESC: Provides garbage collector job functions and usage // TYPE: Job (JavaScript) // =========================================================================== - -let garbageRoutes = [ - false, - [ // GTA 3 - [ // PORTLAND ISLAND (0) - { // ROUTE 0 - name: "Portland #1", - island: 0, - payout: 150, - positions: [ - toVector3(1169.8, -45.54, 10.4), - toVector3(928, -59.1, 8.61), - toVector3(935.4, -262.45, 5.52), - toVector3(935.4, -262.45, 5.52), - toVector3(1042.5, -375.9, 15.4), - toVector3(987, -450.5, 15.39), - toVector3(871.3, -277.07, 5.4), - toVector3(1119.4, -766.7, 15.4), - toVector3(1082.3, -990.8, 15.4), - toVector3(1166.9, -1046.8, 15.41), - toVector3(1310.1, -980.4, 15.46), - toVector3(1129.5, -645.3, 15.4), - toVector3(1128.9, -446.1, 20.41), - toVector3(1226.5, -52.41, 10.42) , - ], - }, - ], - [ // STAUNTON ISLAND (1) - { // ROUTE 0 - name: "Staunton #1", - island: 1, - payout: 150, - positions: [ - toVector3(49.85, -1539.9, 26.6), - toVector3(49.71, -1458.1, 26.6), - toVector3(170.78, -1403.8, 26.59), - toVector3(183.48, -1485.9, 26.6), - toVector3(320.43, -1452.4, 26.6), - toVector3(310.13, -1311.8, 26.6), - toVector3(134.76, -1097.7, 26.6), - toVector3(55.63, -1058.6, 26.6), - toVector3(-0.02, -790.9, 26.64), - ], - }, - ] - ], - - // GTA VC - [ - - ], - - // GTA SA - [ - - ], - - false, - - // GTA IV - [ - - ], -]; - -// =========================================================================== - -function getRandomGarbageRoute(island) { - if(garbageRoutes[getServerGame()][island].length == 1) { - return 0; - } - return getRandom(0, garbageRoutes[getServerGame()][island].length-1); -} - -// =========================================================================== - -function getNextStopOnGarbageRoute(island, garbageRoute, garbageRouteStop) { - if(!isLastStopOnGarbageRoute(island, garbageRoute, garbageRouteStop)) { - return garbageRouteStop+1; - } else { - return garbageRoutes[getServerGame()][island][garbageRoute].positions.length-1; - } -} - -// =========================================================================== - -function isLastStopOnGarbageRoute(island, garbageRoute, garbageRouteStop) { - if(garbageRouteStop == garbageRoutes[getServerGame()][island][garbageRoute].positions.length-1) { - return true; - } - return false; -} - -// =========================================================================== - -function showNextGarbageStop(client) { - getPlayerData(client).jobRouteStop = getNextStopOnGarbageRoute(getPlayerData(client).jobRouteStop, getPlayerData(client).jobRoute, getPlayerData(client).jobRouteStop); - showCurrentGarbageStop(client); -} - -// =========================================================================== - -function showCurrentGarbageStop(client) { - sendNetworkEventToPlayer("vrr.showGarbageStop", client, getGarbageRouteStopPosition(getPlayerIsland(client), getPlayerData(client).jobRoute, getPlayerData(client).jobRouteStop), getColourByName("garbageDriverGreen")); -} - -// =========================================================================== - -function playerArrivedAtGarbageStop(client) { - if(isLastStopOnGarbageRoute(getPlayerData(client).jobRouteIsland, getPlayerData(client).jobRoute, getPlayerData(client).jobRouteStop)) { - finishSuccessfulGarbageRoute(client); - return false; - } - - showGameMessage(client, "⌛ Please wait a moment while the garbage is loaded into your truck.", getColourByName("mediumGrey"), 3500); - freezeGarbageForStop(client); - getPlayerData(client).jobRouteStop = getNextStopOnGarbageRoute(getPlayerData(client).jobRouteIsland, getPlayerData(client).jobRoute, getPlayerData(client).jobRouteStop); - setTimeout(function() { - showCurrentGarbageStop(client); - showGameMessage(client, "Proceed to the next stop (grey checkpoint)", getColourByName("mediumGrey"), 3500); - }, 5000); -} - -// =========================================================================== - -function getGarbageRouteStopPosition(island, garbageRoute, garbageRouteStop) { - return garbageRoutes[getServerGame()][island][garbageRoute].positions[garbageRouteStop]; -} - -// =========================================================================== - -function getGarbageRouteData(island, garbageRoute) { - return garbageRoutes[getServerGame()][island][garbageRoute]; -} - -// =========================================================================== - -function finishSuccessfulGarbageRoute(client) { - respawnVehicle(getPlayerData(client).jobRouteVehicle); - let payout = toInteger(applyServerInflationMultiplier(getGarbageRouteData(getPlayerData(client).jobRouteIsland, getPlayerData(client).jobRoute).payout)); - getPlayerData(client).payDayAmount = getPlayerData(client).payDayAmount + payout; - messagePlayerNormal(client, `You finished the ${getGarbageRouteData(getPlayerData(client).jobRouteIsland, getPlayerData(client).jobRoute).name} garbage route! Your trashmaster has been returned to the garbage depot.`, getColourByName("yellow")); - messagePlayerNormal(client, `You earned $${getGarbageRouteData(getPlayerData(client).jobRouteIsland, getPlayerData(client).jobRoute).payout*getServerData().inflationMultiplier}. Your total paycheck of {ALTCOLOUR}${getPlayerData(client).payDayAmount} will be received in {ALTCOLOUR}${getTimeDifferenceDisplay(sdl.ticks-getPlayerData(client).payDayTickStart)}: $${getPlayerData(client).payDayAmount}`); - getPlayerData(client).jobRouteVehicle = false; - getPlayerData(client).jobRoute = 0; - getPlayerData(client).jobRouteStop = 0; - getPlayerData(client).jobRouteIsland = 0; -} - -// =========================================================================== \ No newline at end of file diff --git a/scripts/server/job/pizza-delivery.js b/scripts/server/job/pizza-delivery.js index 24004ebb..20297b62 100644 --- a/scripts/server/job/pizza-delivery.js +++ b/scripts/server/job/pizza-delivery.js @@ -6,255 +6,3 @@ // DESC: Provides pizza delivery driver job functions and usage // TYPE: Job (JavaScript) // =========================================================================== - -let pizzaDeliveryStops = [ - false, - - [ // GTA 3 (1) - [ // PORTLAND ISLAND (0) - toVector3(1269, -1056.4, 14.75), - toVector3(1088.7, -968.8, 14.91), - toVector3(1059.1, -870.9, 14.91), - toVector3(917.6, -815.9, 14.91), - toVector3(851.1, -766.1, 14.91), - toVector3(838.8, -598.7, 14.91), - toVector3(959.3, -581.6, 14.91), - toVector3(853.1, -485.9, 14.91), - toVector3(838.8, -312.68, 6.8), - toVector3(913.9, -177.4, 4.91), - toVector3(1123.3, -67.74, 7.41), - toVector3(1043.6, -191.63, 4.91), - toVector3(1213.2, -281.3, 25.76), - toVector3(1193.3, -474.3, 24.98), - toVector3(1335.4, -499.7, 45.28), - toVector3(1220.3, -341.4, 26.38), - toVector3(1122.6, -475.6, 19.91), - toVector3(1309.2, -642.4, 12.3), - toVector3(1350.5, -845, 14.91), - toVector3(1322.2, -1025.3, 14.76), - toVector3(1307.5, -995.54, 14.88), - ], - - [ // STAUNTON ISLAND (1) - toVector3(-1.11, -388.4, 16.11), - toVector3(-15.75, -735.3, 26.15), - toVector3(33.63, -1029.4, 26.11), - toVector3(-53.92, -1233.4, 26.11), - toVector3(126.58, -1323.7, 26.11), - toVector3(189.39, -1285.6, 26.11), - toVector3(266.9, -1179.1, 26.11), - toVector3(283.93, -1370.2, 26.11), - toVector3(144.44, -1455.5, 26.11), - toVector3(34.5, -1511.7, 26.11), - toVector3(325.31, -1579, 26.03), - toVector3(302.33, -1417.7, 26.11), - toVector3(309.76, -1290, 26.11), - toVector3(378.5, -1235.1, 26.11), - toVector3(404, -1376.3, 26.11), - toVector3(189.07, -1159.3, 26.11), - toVector3(189.44, -956.9, 26.11), - toVector3(254.18, -722.3, 26.11), - toVector3(383.4, -704.2, 26.11), - toVector3(429.3, -420.6, 22.04), - toVector3(570.9, -336.4, 19.71), - toVector3(267.46, 91.12, 15.96), - toVector3(99.13, -31.96, 16.11), - toVector3(243.94, -187.01, 21.31), - toVector3(99.17, -263.44, 16.11), - toVector3(-26.92, -283.73, 16.11), - ], - ], - - [ // GTA VC - [ // WESTERN ISLAND (0) - toVector3(-997.698, 175.8, 10.704), - toVector3(-607.007, 659.024, 10.9994), - toVector3(-665.23, 843.213, 11.3572), - toVector3(-669.703, 1174.17, 10.9954), - toVector3(19.0071, 967.446, 10.8685), - toVector3(-441.901, 1099.23, 10.9998), - toVector3(-1048.15, 1341.77, 8.76068), - toVector3(-870.697, 1049.45, 11.0081), - toVector3(-683.681, 610.935, 11.0217), - toVector3(-1011.02, 291.984, 11.3042), - toVector3(-1185.89, -264.69, 11.5162), - toVector3(-1106.57, -300.12, 11.189), - toVector3(-1012.97, -372.445, 10.8688), - toVector3(-1018.07, -573.031, 11.0513), - toVector3(-1184.86, -647.271, 11.565), - toVector3(-1034.59, -908.376, 14.0954), - toVector3(-990.653, -1074.29, 14.7919), - toVector3(-1199.02, -946.758, 14.7914), - toVector3(-1431.57, -780.312, 14.7926), - toVector3(-1282.71, -785.966, 14.7917), - toVector3(-1204.48, -939.911, 14.7917), - toVector3(-1006.98, -1079.19, 14.7916), - toVector3(-928.565, -1257.33, 11.9578), - toVector3(-912.603, -1442.4, 11.8644), - toVector3(-683.223, -1389.97, 11.0019), - toVector3(-799.104, -1062.2, 11.0011), - toVector3(-812.002, -672.31, 11.0046), - toVector3(-834.03, -477.273, 11.0118), - toVector3(-840.406, -307.896, 11.0001), - toVector3(-829.729, -119.308, 11.0004), - toVector3(-903.957, 33.4505, 10.6344), - toVector3(-1002.04, -37.9656, 10.9094), - toVector3(-1066.83, -13.3146, 11.3389), - toVector3(-1067.5, 109.544, 11.3122), - toVector3(-1003.59, 171.078, 10.8953), - toVector3(-748.054, 198.243, 11.2455), - toVector3(-850, -110.625, 11.0203), - toVector3(-898.862, -280.373, 10.6645), - toVector3(-1082.1, -294.416, 11.2065), - ], - ], - - - [ // GTA SA - [ // LOS SANTOS ISLAND (0) - toVector3(1823.79, -1852.66, 13.5144), - toVector3(1804.12, -1609.59, 13.4419), - toVector3(1660.32, -1510.09, 13.4877), - toVector3(1612.54, -1322.23, 17.4085), - toVector3(1778.93, -1286.59, 13.5744), - toVector3(1854.72, -1208.16, 20.9552), - toVector3(1659.95, -1158.07, 23.8315), - toVector3(1461.6, -1031.05, 23.7518), - toVector3(1277.71, -1036.63, 31.6085), - toVector3(1322.74, -1151.38, 23.7558), - toVector3(1194.26, -1334.15, 13.4953), - toVector3(1081.29, -1392.64, 13.7023), - toVector3(1034.65, -1555.27, 13.4591), - toVector3(1033.26, -1782.3, 13.6323), - toVector3(1262.27, -1855, 13.4887), - toVector3(1445.39, -1875.5, 13.4944), - toVector3(1742.23, -2168.78, 13.557), - toVector3(1943.35, -2169.25, 13.4741), - toVector3(1963.51, -1969.6, 13.5867), - toVector3(1824.2, -1886.48, 13.4287), - toVector3(1824.17, -1851.5, 13.5134), - toVector3(1853.95, -1395.48, 13.4882), - toVector3(1659.33, -1158.59, 23.8368), - toVector3(1375.08, -1139.12, 23.7585), - toVector3(1186.53, -1139.9, 23.8007), - toVector3(1021.63, -1139.48, 23.7568), - toVector3(965.119, -1100.04, 23.7962), - toVector3(1058.53, -1042.64, 32.03), - toVector3(1238.74, -1041.7, 31.8307), - toVector3(1377.08, -977.352, 32.2744), - toVector3(1461.71, -731.011, 93.5068), - toVector3(1248.83, -729.438, 94.7962), - toVector3(932.221, -828.904, 94.6709), - toVector3(717.372, -982.938, 52.8477), - toVector3(452.042, -1182.3, 66.3269), - toVector3(287.664, -1221.08, 75.3682), - toVector3(225.497, -1346.85, 51.5658), - toVector3(438.728, -1720.92, 9.92785), - toVector3(894.789, -1788.3, 13.5674), - toVector3(919.419, -1592.92, 13.4843), - toVector3(939.902, -1408.49, 13.3463), - toVector3(1207.53, -1329.3, 13.5012), - toVector3(1324.24, -1282.88, 13.4815), - toVector3(1296.85, -1551.41, 13.4839), - toVector3(1294.85, -1811.15, 13.4816), - toVector3(1649.38, -1875.42, 13.4858), - toVector3(1819.59, -1870.9, 13.4987), - toVector3(1823.94, -1853.88, 13.5103), - toVector3(1823.97, -1655.31, 13.4738), - toVector3(1854.81, -1409.54, 13.4829), - toVector3(1869.02, -1152.77, 23.8096), - toVector3(1975.68, -1104.29, 25.5835), - toVector3(2077.6, -985.15, 50.0375), - toVector3(2161.61, -1022.78, 62.5533), - toVector3(2173.38, -1148.91, 24.9203), - toVector3(2166.28, -1267.17, 23.9138), - toVector3(2087.27, -1298.99, 23.9193), - toVector3(2008.67, -1338.34, 23.9207), - toVector3(2026.04, -1468.12, 14.867), - toVector3(2108.83, -1684.64, 13.4771), - toVector3(2185.67, -1745.22, 13.4681), - toVector3(2287.18, -1734.76, 13.4821), - toVector3(2411.06, -1793.34, 13.4746), - toVector3(2451.02, -1934.86, 13.4209), - toVector3(2529.97, -1750.13, 13.479), - toVector3(2685.6, -1659.48, 11.4476), - toVector3(2739.7, -1524.93, 29.6406), - toVector3(2739.95, -1278.48, 57.8435), - toVector3(2683.93, -1068.66, 69.2199), - toVector3(2578.78, -1045.36, 69.5098), - toVector3(2326.9, -1128.69, 27.8126), - toVector3(2367.83, -1270.92, 23.941), - toVector3(2324.15, -1382.25, 23.9621), - toVector3(2137.14, -1382.12, 23.9376), - toVector3(2010.74, -1459.87, 13.4914), - toVector3(1824.35, -1562.74, 13.4622), - toVector3(1818.98, -1872.52, 13.5075), - toVector3(1823.79, -1852.66, 13.5144), - toVector3(1804.12, -1609.59, 13.4419), - toVector3(1660.32, -1510.09, 13.4877), - toVector3(1612.54, -1322.23, 17.4085), - toVector3(1778.93, -1286.59, 13.5744), - toVector3(1854.72, -1208.16, 20.9552), - toVector3(1659.95, -1158.07, 23.8315), - toVector3(1461.6, -1031.05, 23.7518), - toVector3(1277.71, -1036.63, 31.6085), - toVector3(1322.74, -1151.38, 23.7558), - toVector3(1194.26, -1334.15, 13.4953), - toVector3(1081.29, -1392.64, 13.7023), - toVector3(1034.65, -1555.27, 13.4591), - toVector3(1033.26, -1782.3, 13.6323), - toVector3(1262.27, -1855, 13.4887), - toVector3(1445.39, -1875.5, 13.4944), - toVector3(1742.23, -2168.78, 13.557), - toVector3(1943.35, -2169.25, 13.4741), - toVector3(1963.51, -1969.6, 13.5867), - toVector3(1824.2, -1886.48, 13.4287), - ], - ], - - // GTA UG - [ - - ], - - // GTA IV - [ - - ], -]; - -// =========================================================================== - -function getRandomPizzaDeliveryStop(island) { - if(pizzaDeliveryStops[getServerGame()][island].length == 1) { - return 0; - } - return getRandom(0, pizzaDeliveryStops[getServerGame()][island].length-1); -} - -// =========================================================================== - -function showCurrentPizzaDeliveryStop(client) { - sendJobDeliveryPointToPlayer(client, getPizzaDeliveryStopPosition(getPlayerIsland(client), getPlayerData(client).jobRoute), getColourByName("deliveryPurple")) -} - -// =========================================================================== - -function playerArrivedAtPizzaDeliveryDestination(client) { - respawnVehicle(getPlayerData(client).jobDeliveryVehicle); - let payout = applyServerInflationMultiplier(getPizzaDeliveryPay(getPlayerData(client).jobDeliveryStart, getPlayerData(client).jobDeliveryStop)); - getPlayerData(client).payDayAmount += payout; - messagePlayerNormal(client, `You delivered the pizza! Return to the pizza restaurant if you want to deliver another pizza.`, getColourByName("yellow")); - messagePlayerNormal(client, `You earned $${payout}. Your total paycheck of {ALTCOLOUR}${getPlayerData(client).payDayAmount} will be received in {ALTCOLOUR}${getTimeDisplayUntilPlayerPayDay(client)}`); - getPlayerData(client).jobDeliveryVehicle = false; - getPlayerData(client).jobDeliveryStart = 0; - getPlayerData(client).jobDeliveryStop = 0; -} - -// =========================================================================== - -function getPizzaDeliveryPay(startPoint, stopPoint) { - return Math.floor(getDistance(startPoint, stopPoint)); -} - -// =========================================================================== \ No newline at end of file diff --git a/scripts/server/job/police.js b/scripts/server/job/police.js index e2c3f155..b842a8a2 100644 --- a/scripts/server/job/police.js +++ b/scripts/server/job/police.js @@ -6,247 +6,3 @@ // DESC: Provides police officer job functions and usage // TYPE: Job (JavaScript) // =========================================================================== - -let patrolRoutes = [ - false, - - [ // GTA 3 (1) - [ // PORTLAND (0) - - ], - - [ // STAUNTON ISLAND (1) - { // SECTOR 1 (0) - name: "Staunton Island Sector 1", - island: 0, - payout: 175, - type: VRR_PATROLTYPE_VEHICLE, - positions: [ - toVector3(404.5, -1209.73, 25.8024), - toVector3(334.831, -1388.93, 25.8005), - toVector3(143.949, -1433.8, 25.802), - toVector3(144.79, -1592.07, 25.8019), - toVector3(49.9422, -1566.3, 25.8021), - toVector3(48.9107, -1324.22, 25.8026), - toVector3(50.0236, -1101.78, 25.8023), - toVector3(131.694, -1111.31, 25.7952), - toVector3(189.424, -1063.86, 25.7998), - toVector3(272.875, -1044.04, 25.8019), - toVector3(355.409, -847.512, 25.1725), - toVector3(521.08, -399.068, 20.9302), - toVector3(403.586, -471.898, 25.8008), - toVector3(403.915, -608.12, 25.7963), - toVector3(324.298, -687.727, 25.7945), - toVector3(230.278, -738.004, 25.8017), - toVector3(145.977, -907.481, 25.8045), - toVector3(81.1892, -924.272, 25.8088), - toVector3(35.0571, -1023.52, 25.7989), - toVector3(40.047, -1224.51, 25.801), - toVector3(105.924, -1313.85, 25.7972), - toVector3(149.367, -1377.78, 25.8016), - toVector3(271.09, -1399.14, 25.8019), - toVector3(303.644, -1079.71, 25.8029), - toVector3(342.905, -873.693, 22.5513), - toVector3(542.573, -466.857, 23.3019), - toVector3(516.223, -398.79, 20.9548), - toVector3(404.847, -480.079, 25.7463), - toVector3(404.132, -908.893, 25.7912), - toVector3(403.389, -1098.75, 25.8034), - ], - } - ], - - [ // SHORESIDE VALE (2) - - ] - ], - - [ // GTA VC (2) - [ // EAST (1) - - ], - - [ // WEST (2) - - ] - ], -]; - -// =========================================================================== - -function policeTazerCommand(command, params, client) { - if(!canPlayerUseJobs(client)) { - messagePlayerError(client, "You are not allowed to use jobs."); - return false; - } - - if(!canPlayerUsePoliceJob(client)) { - messagePlayerError(client, "You are not allowed to use the police job."); - return false; - } - - if(!isPlayerWorking(client)) { - messagePlayerError(client, "You are not working! Use /startwork first."); - return false; - } - - if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) { - messagePlayerError(client, "You don't have a police job."); - return false; - } - - return true; -} - -// =========================================================================== - -function policeCuffCommand(command, params, client) { - if(!canPlayerUseJobs(client)) { - messagePlayerError(client, "You are not allowed to use jobs."); - return false; - } - - if(!canPlayerUsePoliceJob(client)) { - messagePlayerError(client, "You are not allowed to use the police job."); - return false; - } - - if(!isPlayerWorking(client)) { - messagePlayerError(client, "You are not working! Use /startwork first."); - return false; - } - - if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) { - messagePlayerError(client, "You don't have a police job."); - return false; - } - - return true; -} - -// =========================================================================== - -function policeArrestCommand(command, params, client) { - if(!canPlayerUseJobs(client)) { - messagePlayerError(client, "You are not allowed to use jobs."); - return false; - } - - if(!canPlayerUsePoliceJob(client)) { - messagePlayerError(client, "You are not allowed to use the police job."); - return false; - } - - if(!isPlayerWorking(client)) { - messagePlayerError(client, "You are not working! Use /startwork first."); - return false; - } - - if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) { - messagePlayerError(client, "You don't have a police job."); - return false; - } - - return true; -} - -// =========================================================================== - -function policeSearchCommand(command, params, client) { - if(!canPlayerUseJobs(client)) { - messagePlayerError(client, "You are not allowed to use jobs."); - return false; - } - - if(!canPlayerUsePoliceJob(client)) { - messagePlayerError(client, "You are not allowed to use the police job."); - return false; - } - - if(!isPlayerWorking(client)) { - messagePlayerError(client, "You are not working! Use /startwork first."); - return false; - } - - if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) { - messagePlayerError(client, "You don't have a police job."); - return false; - } - - return true; -} - -// =========================================================================== - -function policeDragCommand(command, params, client) { - if(!canPlayerUseJobs(client)) { - messagePlayerError(client, "You are not allowed to use jobs."); - return false; - } - - if(!canPlayerUsePoliceJob(client)) { - messagePlayerError(client, "You are not allowed to use the police job."); - return false; - } - - if(!isPlayerWorking(client)) { - messagePlayerError(client, "You are not working! Use /startwork first."); - return false; - } - - if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) { - messagePlayerError(client, "You don't have a police job."); - return false; - } - - return true; -} - -// =========================================================================== - -function policeDetainCommand(command, params, client) { - if(!canPlayerUseJobs(client)) { - messagePlayerError(client, "You are not allowed to use jobs."); - return false; - } - - if(!canPlayerUsePoliceJob(client)) { - messagePlayerError(client, "You are not allowed to use the police job."); - return false; - } - - if(!isPlayerWorking(client)) { - messagePlayerError(client, "You are not working! Use /startwork first."); - return false; - } - - if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) { - messagePlayerError(client, "You don't have a police job."); - return false; - } - - return true; -} - -// =========================================================================== - -function playerArivedAtPolicePatrolPoint(client) { - if(isLastStopOnPolicePatrolRoute(getPlayerData(client).jobRouteIsland, getPlayerData(client).jobRoute, getPlayerData(client).jobRouteStop)) { - messagePlayerNormal(client, `You finished the ${getPatrolRouteData(getPlayerData(client).jobRouteIsland, getPlayerData(client).jobRoute).name} patrol route! You earned $${getBusRouteData(getPlayerData(client).jobRouteIsland, getPlayerData(client).jobRoute).payout*getServerData().inflationMultiplier}`, getColourByName("yellow")); - messagePlayerNormal(client, `You can either continue driving the patrol route again, or use /stoproute to end your patrol.`, getColourByName("yellow")); - givePlayerCash(client, getPolicePatrolRouteData(getPlayerData(client).jobRouteIsland, getPlayerData(client).jobRoute).payout*getServerData().inflationMultiplier); - updatePlayerCash(client); - getPlayerData(client).jobRouteVehicle = false; - getPlayerData(client).jobRoute = 0; - getPlayerData(client).jobRouteStop = 0; - getPlayerData(client).jobRouteIsland = 0; - getPlayerData(client).jobRouteState = VRR_JOBROUTE_INPROGRESS; - return false; - } - - showGameMessage(client, "Proceed to the next point on your patrol route", getColourByName("policeBlue"), 2000); - getPlayerData(client).jobRouteStop = getNextStopOnPolicePatrolRoute(getPlayerData(client).jobRouteIsland, getPlayerData(client).jobRoute, getPlayerData(client).jobRouteStop); - showCurrentPolicePatrolPoint(client); -} - -// =========================================================================== \ No newline at end of file