Skip to content

Commit

Permalink
Duplicated on_duty locale changed to off_duty
Browse files Browse the repository at this point in the history
  • Loading branch information
GhzGarage committed May 6, 2024
1 parent e4aa57f commit 03434e8
Show file tree
Hide file tree
Showing 20 changed files with 551 additions and 473 deletions.
102 changes: 51 additions & 51 deletions config.lua
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
Config = {

jobRequired = "taxi",
jobRequired = 'taxi',

Management = false, -- if true, the money gained from the trips, will go to the boss menu funds

-- set this to false if you want to use distance checks
UseTarget = GetConvar('UseTarget', 'false') == 'true',

DefaultTextLocation = "left", -- left, right, top
DefaultTextLocation = 'left', -- left, right, top

AllowedVehicles = {
[1] = {
model = "taxi",
label = Lang:t("info.taxi_label_1")
[1] = {
model = 'taxi',
label = Lang:t('info.taxi_label_1')
},
},

Meter = {
["defaultPrice"] = 125.0, -- price per mile
["startingPrice"] = 0 -- static starting price
['defaultPrice'] = 125.0, -- price per mile
['startingPrice'] = 0 -- static starting price
},

Location = vector3(909.5, -177.35, 74.22), -- map blip position
Location = vector3(909.5, -177.35, 74.22), -- map blip position
parkLocation = vector3(909.5, -177.35, 74.22), -- vehicle garage location

Duty = vector3(894.88, -179.22, 74.7),

NPCLocations = {
TakeLocations = {
[1] = vector4(257.61, -380.57, 44.71, 340.5),
Expand Down Expand Up @@ -76,50 +76,50 @@ Config = {
PZLocations = {

TakeLocations = {
[1] = {coord = vector3(258.98, -377.9, 44.7), height = 17.6, width = 4.2, heading = 69, minZ = 43.75, maxZ = 45.55},
[2] = {coord = vector3(-50.06, -784.57, 44.16), height = 17.6, width = 4.2, heading = 62, minZ = 43.21, maxZ = 45.01},
[3] = {coord = vector3(238.93, -858.91, 29.67), height = 17.6, width = 4.2, heading = 71, minZ = 28.72, maxZ = 30.52},
[4] = {coord = vector3(823.4, -1882.96, 29.29), height = 17.6, width = 4.2, heading = 167, minZ = 28.34, maxZ = 30.14},
[5] = {coord = vector3(354.05, -1971.57, 24.43), height = 17.6, width = 4.2, heading = 236, minZ = 23.48, maxZ = 25.28},
[6] = {coord = vector3(-225.61, -2043.63, 27.62), height = 17.6, width = 4.2, heading = 143, minZ = 26.67, maxZ = 28.47},
[7] = {coord = vector3(-1048.72, -2714.2, 13.76), height = 17.6, width = 4.2, heading = 240, minZ = 12.81, maxZ = 14.61},
[8] = {coord = vector3(-776.15, -1280.37, 5.0), height = 17.6, width = 4.2, heading = 261, minZ = 4.05, maxZ = 5.85},
[9] = {coord = vector3(-1180.3, -1304.22, 5.15), height = 17.6, width = 4.2, heading = 205, minZ = 4.2, maxZ = 6.0},
[10] = {coord = vector3(-1326.52, -833.32, 16.85), height = 17.6, width = 4.2, heading = 225, minZ = 15.9, maxZ = 17.7},
[11] = {coord = vector3(-1610.24, -1015.33, 13.07), height = 17.6, width = 4.2, heading = 227, minZ = 12.12, maxZ = 13.92},
[12] = {coord = vector3(-1396.85, -583.72, 30.08), height = 17.6, width = 4.2, heading = 299, minZ = 29.13, maxZ = 30.93},
[13] = {coord = vector3(-513.06, -263.2, 35.43), height = 17.6, width = 4.2, heading = 293, minZ = 34.48, maxZ = 36.28},
[14] = {coord = vector3(-756.46, -35.84, 37.69), height = 17.6, width = 4.2, heading = 297, minZ = 36.74, maxZ = 38.54},
[15] = {coord = vector3(-1285.33, 293.67, 64.83), height = 17.6, width = 4.2, heading = 241, minZ = 63.88, maxZ = 65.68},
[16] = {coord = vector3(-806.68, 825.2, 202.81), height = 21.2, width = 4.2, heading = 276, minZ = 200.46, maxZ = 204.66},
},
[1] = { coord = vector3(258.98, -377.9, 44.7), height = 17.6, width = 4.2, heading = 69, minZ = 43.75, maxZ = 45.55 },
[2] = { coord = vector3(-50.06, -784.57, 44.16), height = 17.6, width = 4.2, heading = 62, minZ = 43.21, maxZ = 45.01 },
[3] = { coord = vector3(238.93, -858.91, 29.67), height = 17.6, width = 4.2, heading = 71, minZ = 28.72, maxZ = 30.52 },
[4] = { coord = vector3(823.4, -1882.96, 29.29), height = 17.6, width = 4.2, heading = 167, minZ = 28.34, maxZ = 30.14 },
[5] = { coord = vector3(354.05, -1971.57, 24.43), height = 17.6, width = 4.2, heading = 236, minZ = 23.48, maxZ = 25.28 },
[6] = { coord = vector3(-225.61, -2043.63, 27.62), height = 17.6, width = 4.2, heading = 143, minZ = 26.67, maxZ = 28.47 },
[7] = { coord = vector3(-1048.72, -2714.2, 13.76), height = 17.6, width = 4.2, heading = 240, minZ = 12.81, maxZ = 14.61 },
[8] = { coord = vector3(-776.15, -1280.37, 5.0), height = 17.6, width = 4.2, heading = 261, minZ = 4.05, maxZ = 5.85 },
[9] = { coord = vector3(-1180.3, -1304.22, 5.15), height = 17.6, width = 4.2, heading = 205, minZ = 4.2, maxZ = 6.0 },
[10] = { coord = vector3(-1326.52, -833.32, 16.85), height = 17.6, width = 4.2, heading = 225, minZ = 15.9, maxZ = 17.7 },
[11] = { coord = vector3(-1610.24, -1015.33, 13.07), height = 17.6, width = 4.2, heading = 227, minZ = 12.12, maxZ = 13.92 },
[12] = { coord = vector3(-1396.85, -583.72, 30.08), height = 17.6, width = 4.2, heading = 299, minZ = 29.13, maxZ = 30.93 },
[13] = { coord = vector3(-513.06, -263.2, 35.43), height = 17.6, width = 4.2, heading = 293, minZ = 34.48, maxZ = 36.28 },
[14] = { coord = vector3(-756.46, -35.84, 37.69), height = 17.6, width = 4.2, heading = 297, minZ = 36.74, maxZ = 38.54 },
[15] = { coord = vector3(-1285.33, 293.67, 64.83), height = 17.6, width = 4.2, heading = 241, minZ = 63.88, maxZ = 65.68 },
[16] = { coord = vector3(-806.68, 825.2, 202.81), height = 21.2, width = 4.2, heading = 276, minZ = 200.46, maxZ = 204.66 },
},

DropLocations = {
[1] = {coord = vector3(-1073.21, -265.35, 37.35), height = 21.2, width = 4.2, heading = 296, minZ = 35.0, maxZ = 39.2},
[2] = {coord = vector3(-1411.45, -590.98, 29.99), height = 21.2, width = 4.2, heading = 299, minZ = 27.64, maxZ = 31.84},
[3] = {coord = vector3(-678.68, -845.54, 23.53), height = 21.2, width = 4.2, heading = 269, minZ = 21.18, maxZ = 25.38},
[4] = {coord = vector3(-159.11, -1565.46, 34.69), height = 21.2, width = 4.2, heading = 321, minZ = 32.34, maxZ = 36.54},
[5] = {coord = vector3(442.12, -1685.31, 28.85), height = 21.2, width = 4.2, heading = 321, minZ = 26.5, maxZ = 30.7},
[6] = {coord = vector3(1120.51, -958.97, 46.83), height = 21.2, width = 4.2, heading = 286, minZ = 44.48, maxZ = 48.68},
[7] = {coord = vector3(1240.79, -377.77, 68.61), height = 21.2, width = 4.2, heading = 249, minZ = 66.26, maxZ = 70.46},
[8] = {coord = vector3(923.66, -2226.07, 29.98), height = 21.2, width = 4.2, heading = 354, minZ = 27.63, maxZ = 31.83},
[9] = {coord = vector3(1920.15, 3701.6, 32.26), height = 21.2, width = 4.2, heading = 299, minZ = 29.91, maxZ = 34.11},
[10] = {coord = vector3(1661.91, 4875.87, 41.66), height = 21.2, width = 4.2, heading = 8, minZ = 39.31, maxZ = 43.51},
[11] = {coord = vector3(-9.46, 6529.92, 30.95), height = 21.2, width = 4.2, heading = 314, minZ = 28.6, maxZ = 32.8},
[12] = {coord = vector3(-3233.12, 1010.33, 11.72), height = 21.2, width = 4.2, heading = 357, minZ = 9.37, maxZ = 13.57},
[13] = {coord = vector3(-1604.11, -401.71, 41.95), height = 21.2, width = 4.2, heading = 322, minZ = 39.6, maxZ = 43.8},
[14] = {coord = vector3(-586.48, -255.96, 36.53), height = 21.2, width = 4.2, heading = 31, minZ = 34.68, maxZ = 37.48},
[15] = {coord = vector3(23.51, -60.47, 63.2), height = 21.2, width = 4.2, heading = 156, minZ = 60.55, maxZ = 65.75},
[16] = {coord = vector3(550.26, 172.54, 99.71), height = 21.2, width = 4.2, heading = 161, minZ = 98.51, maxZ = 100.91},
[17] = {coord = vector3(-1048.62, -2540.53, 13.3), height = 21.2, width = 4.2, heading = 151, minZ = 12.9, maxZ = 14.9},
[18] = {coord = vector3(-10.06, -544.39, 38.28), height = 21.2, width = 4.2, heading = 91, minZ = 36.28, maxZ = 39.88},
[19] = {coord = vector3(-7.91, -258.19, 46.49), height = 21.2, width = 4.2, heading = 71, minZ = 45.29, maxZ = 47.69},
[20] = {coord = vector3(-743.03, 818.9, 213.16), height = 21.2, width = 4.2, heading = 38, minZ = 211.96, maxZ = 214.36},
[21] = {coord = vector3(218.25, 677.55, 188.87), height = 21.2, width = 4.2, heading = 163, minZ = 187.67, maxZ = 190.07},
[22] = {coord = vector3(264.47, 1138.41, 221.36), height = 21.2, width = 4.2, heading = 203, minZ = 220.16, maxZ = 222.56},
[23] = {coord = vector3(220.47, -1010.7, 28.82), height = 21.2, width = 4.2, heading = 158, minZ = 28.02, maxZ = 30.42},
[1] = { coord = vector3(-1073.21, -265.35, 37.35), height = 21.2, width = 4.2, heading = 296, minZ = 35.0, maxZ = 39.2 },
[2] = { coord = vector3(-1411.45, -590.98, 29.99), height = 21.2, width = 4.2, heading = 299, minZ = 27.64, maxZ = 31.84 },
[3] = { coord = vector3(-678.68, -845.54, 23.53), height = 21.2, width = 4.2, heading = 269, minZ = 21.18, maxZ = 25.38 },
[4] = { coord = vector3(-159.11, -1565.46, 34.69), height = 21.2, width = 4.2, heading = 321, minZ = 32.34, maxZ = 36.54 },
[5] = { coord = vector3(442.12, -1685.31, 28.85), height = 21.2, width = 4.2, heading = 321, minZ = 26.5, maxZ = 30.7 },
[6] = { coord = vector3(1120.51, -958.97, 46.83), height = 21.2, width = 4.2, heading = 286, minZ = 44.48, maxZ = 48.68 },
[7] = { coord = vector3(1240.79, -377.77, 68.61), height = 21.2, width = 4.2, heading = 249, minZ = 66.26, maxZ = 70.46 },
[8] = { coord = vector3(923.66, -2226.07, 29.98), height = 21.2, width = 4.2, heading = 354, minZ = 27.63, maxZ = 31.83 },
[9] = { coord = vector3(1920.15, 3701.6, 32.26), height = 21.2, width = 4.2, heading = 299, minZ = 29.91, maxZ = 34.11 },
[10] = { coord = vector3(1661.91, 4875.87, 41.66), height = 21.2, width = 4.2, heading = 8, minZ = 39.31, maxZ = 43.51 },
[11] = { coord = vector3(-9.46, 6529.92, 30.95), height = 21.2, width = 4.2, heading = 314, minZ = 28.6, maxZ = 32.8 },
[12] = { coord = vector3(-3233.12, 1010.33, 11.72), height = 21.2, width = 4.2, heading = 357, minZ = 9.37, maxZ = 13.57 },
[13] = { coord = vector3(-1604.11, -401.71, 41.95), height = 21.2, width = 4.2, heading = 322, minZ = 39.6, maxZ = 43.8 },
[14] = { coord = vector3(-586.48, -255.96, 36.53), height = 21.2, width = 4.2, heading = 31, minZ = 34.68, maxZ = 37.48 },
[15] = { coord = vector3(23.51, -60.47, 63.2), height = 21.2, width = 4.2, heading = 156, minZ = 60.55, maxZ = 65.75 },
[16] = { coord = vector3(550.26, 172.54, 99.71), height = 21.2, width = 4.2, heading = 161, minZ = 98.51, maxZ = 100.91 },
[17] = { coord = vector3(-1048.62, -2540.53, 13.3), height = 21.2, width = 4.2, heading = 151, minZ = 12.9, maxZ = 14.9 },
[18] = { coord = vector3(-10.06, -544.39, 38.28), height = 21.2, width = 4.2, heading = 91, minZ = 36.28, maxZ = 39.88 },
[19] = { coord = vector3(-7.91, -258.19, 46.49), height = 21.2, width = 4.2, heading = 71, minZ = 45.29, maxZ = 47.69 },
[20] = { coord = vector3(-743.03, 818.9, 213.16), height = 21.2, width = 4.2, heading = 38, minZ = 211.96, maxZ = 214.36 },
[21] = { coord = vector3(218.25, 677.55, 188.87), height = 21.2, width = 4.2, heading = 163, minZ = 187.67, maxZ = 190.07 },
[22] = { coord = vector3(264.47, 1138.41, 221.36), height = 21.2, width = 4.2, heading = 203, minZ = 220.16, maxZ = 222.56 },
[23] = { coord = vector3(220.47, -1010.7, 28.82), height = 21.2, width = 4.2, heading = 158, minZ = 28.02, maxZ = 30.42 },
},
},
},

NpcSkins = {
[1] = {
Expand Down Expand Up @@ -281,4 +281,4 @@ Config = {
vector4(918.3217, -167.1944, 74.2036, 101.5165),
vector4(920.6716, -163.4763, 74.4108, 96.2972)
},
}
}
16 changes: 8 additions & 8 deletions html/meter.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import url('https://fonts.googleapis.com/css?family=Lato&display=swap');
@import url("https://fonts.googleapis.com/css?family=Lato&display=swap");

:root {
--meter-size-width: 45vh;
Expand Down Expand Up @@ -27,7 +27,7 @@

#total-price {
color: rgb(64, 160, 64);
font-family: 'Lato';
font-family: "Lato";
font-weight: bold;
letter-spacing: 0.1vh;
font-size: 4.1vh;
Expand All @@ -39,7 +39,7 @@

#total-price-label {
color: rgba(255, 255, 255, 0.75);
font-family: 'Lato';
font-family: "Lato";
font-weight: lighter;
font-size: 1.1vh;
letter-spacing: 0.1vh;
Expand All @@ -51,7 +51,7 @@

#total-distance {
color: rgb(255, 153, 57);
font-family: 'Lato';
font-family: "Lato";
font-weight: bold;
letter-spacing: 0.1vh;
font-size: 4.1vh;
Expand All @@ -63,7 +63,7 @@

#total-distance-label {
color: rgba(255, 255, 255, 0.75);
font-family: 'Lato';
font-family: "Lato";
font-weight: lighter;
font-size: 1.1vh;
letter-spacing: 0.1vh;
Expand All @@ -75,7 +75,7 @@

#total-price-per-100m {
color: rgb(56, 143, 243);
font-family: 'Lato';
font-family: "Lato";
font-weight: bold;
letter-spacing: 0.1vh;
font-size: 4.1vh;
Expand All @@ -87,7 +87,7 @@

#total-price-per-100m-label {
color: rgba(255, 255, 255, 0.75);
font-family: 'Lato';
font-family: "Lato";
font-weight: lighter;
font-size: 1.1vh;
letter-spacing: 0.1vh;
Expand Down Expand Up @@ -120,4 +120,4 @@

.toggle-meter-btn:hover {
background: rgba(66, 66, 66, 0.657);
}
}
15 changes: 7 additions & 8 deletions html/meter.html
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/ui/1.13.0/jquery-ui.min.js" integrity="sha256-hlKLmzaRlE8SCJC1Kw8zoUbU8BxA+8kR3gseuKfMjxA=" crossorigin="anonymous"></script>
<link rel="stylesheet" href="./reset.css">
<link rel="stylesheet" href="meter.css">
<link rel="stylesheet" href="./reset.css" />
<link rel="stylesheet" href="meter.css" />
<title>Taxi Meter</title>
</head>
<body>
<div class="container">
<img src="./g5-meter.png" alt="g5-meter" id="g5-meter">
<img src="./g5-meter.png" alt="g5-meter" id="g5-meter" />
<div class="g5-meter">

<span id="total-price">$ 0.00</span>
<span id="total-price-label">Total Price $</span>

<span id="total-distance">0.0 mi</span>
<span id="total-distance-label">Total Distance</span>

<span id="total-price-per-100m"></span>
<span id="total-price-per-100m-label">Price p/ mile</span>
<span id="total-price-per-100m-label">Price p/ mile</span>

<div class="toggle-meter-btn">
<p>Stopped</p>
Expand Down
114 changes: 56 additions & 58 deletions html/meter.js
Original file line number Diff line number Diff line change
@@ -1,81 +1,79 @@
let meterStarted = false;

const updateMeter = (meterData) => {
$("#total-price").html("$ " + meterData.currentFare.toFixed(2));
$("#total-distance").html(
(meterData.distanceTraveled).toFixed(2) + " mi"
);
$("#total-price").html("$ " + meterData.currentFare.toFixed(2));
$("#total-distance").html(meterData.distanceTraveled.toFixed(2) + " mi");
};

const resetMeter = () => {
$("#total-price").html("$ 0.00");
$("#total-distance").html("0.00 mi");
$("#total-price").html("$ 0.00");
$("#total-distance").html("0.00 mi");
};

const toggleMeter = (enabled) => {
if (enabled) {
$(".toggle-meter-btn").html("<p>Started</p>");
$(".toggle-meter-btn p").css({ color: "rgb(51, 160, 37)" });
} else {
$(".toggle-meter-btn").html("<p>Stopped</p>");
$(".toggle-meter-btn p").css({ color: "rgb(231, 30, 37)" });
}
if (enabled) {
$(".toggle-meter-btn").html("<p>Started</p>");
$(".toggle-meter-btn p").css({ color: "rgb(51, 160, 37)" });
} else {
$(".toggle-meter-btn").html("<p>Stopped</p>");
$(".toggle-meter-btn p").css({ color: "rgb(231, 30, 37)" });
}
};

const meterToggle = () => {
if (!meterStarted) {
$.post(
"https://qb-taxijob/enableMeter",
JSON.stringify({
enabled: true,
})
);
toggleMeter(true);
meterStarted = true;
} else {
$.post(
"https://qb-taxijob/enableMeter",
JSON.stringify({
enabled: false,
})
);
toggleMeter(false);
meterStarted = false;
}
if (!meterStarted) {
$.post(
"https://qb-taxijob/enableMeter",
JSON.stringify({
enabled: true,
})
);
toggleMeter(true);
meterStarted = true;
} else {
$.post(
"https://qb-taxijob/enableMeter",
JSON.stringify({
enabled: false,
})
);
toggleMeter(false);
meterStarted = false;
}
};

const openMeter = (meterData) => {
$(".container").fadeIn(150);
$("#total-price-per-100m").html("$ " + meterData.defaultPrice.toFixed(2));
$(".container").fadeIn(150);
$("#total-price-per-100m").html("$ " + meterData.defaultPrice.toFixed(2));
};

const closeMeter = () => {
$(".container").fadeOut(150);
$(".container").fadeOut(150);
};

$(document).ready(function () {
$(".container").hide();
window.addEventListener("message", (event) => {
const eventData = event.data;
switch (eventData.action) {
case "openMeter":
if (eventData.toggle) {
openMeter(eventData.meterData);
} else {
closeMeter();
$(".container").hide();
window.addEventListener("message", (event) => {
const eventData = event.data;
switch (eventData.action) {
case "openMeter":
if (eventData.toggle) {
openMeter(eventData.meterData);
} else {
closeMeter();
}
break;
case "toggleMeter":
meterToggle();
break;
case "updateMeter":
updateMeter(eventData.meterData);
break;
case "resetMeter":
resetMeter();
break;
default:
break;
}
break;
case "toggleMeter":
meterToggle();
break;
case "updateMeter":
updateMeter(eventData.meterData);
break;
case "resetMeter":
resetMeter();
break;
default:
break;
}
});
});
});
Loading

0 comments on commit 03434e8

Please sign in to comment.