Taximeter fix clientside
This commit is contained in:
@@ -34,12 +34,9 @@ export default function taximeterInput(globalData: GlobalData) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function myTimer() {
|
function myTimer() {
|
||||||
mp.gui.chat.push("" + totalPrice);
|
|
||||||
//if (mp.players.local.vehicle.getNumberOfPassengers() == 0) return;
|
|
||||||
if (totalPrice == lastPrice) return;
|
if (totalPrice == lastPrice) return;
|
||||||
let payPrice = +totalPrice - +lastPrice;
|
let payPrice = +totalPrice - +lastPrice;
|
||||||
lastPrice = totalPrice;
|
lastPrice = totalPrice;
|
||||||
mp.gui.chat.push("" + totalPrice);
|
|
||||||
mp.events.callRemote("SERVER:payFare", payPrice, lastkilometer);
|
mp.events.callRemote("SERVER:payFare", payPrice, lastkilometer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,7 +54,6 @@ export default function taximeterInput(globalData: GlobalData) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
mp.events.add("CLIENT:updateFare", (km) => {
|
mp.events.add("CLIENT:updateFare", (km) => {
|
||||||
mp.gui.chat.push("" + lastkilometer)
|
|
||||||
browser.execute(`updateKilometer('${JSON.parse(km)}')`)
|
browser.execute(`updateKilometer('${JSON.parse(km)}')`)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ export default function keys(globalData: GlobalData) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//2 // Job Starten
|
//J // Job Starten
|
||||||
mp.keys.bind(0x4A, false, () => {
|
mp.keys.bind(0x4A, false, () => {
|
||||||
if (!globalData.InChat && !globalData.InInput && !globalData.InMenu && globalData.LoggedIn) {
|
if (!globalData.InChat && !globalData.InInput && !globalData.InMenu && globalData.LoggedIn) {
|
||||||
mp.events.callRemote("CLIENT:JobManager_ShowJobMenu");
|
mp.events.callRemote("CLIENT:JobManager_ShowJobMenu");
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ const PRICE_KM = document.getElementById("taximeter-price-kilometer");
|
|||||||
const KILOMETER = document.getElementById("taximeter-kilometer");
|
const KILOMETER = document.getElementById("taximeter-kilometer");
|
||||||
|
|
||||||
function updateKilometer(km) {
|
function updateKilometer(km) {
|
||||||
|
lastKilometer = +lastKilometer + +km;
|
||||||
UpdateTotalPrice();
|
UpdateTotalPrice();
|
||||||
KILOMETER.innerHTML = (Math.round((lastKilometer + Number.EPSILON) * 1000) / 1000).toString();
|
KILOMETER.innerHTML = (Math.round((lastKilometer + Number.EPSILON) * 1000) / 1000).toString();
|
||||||
}
|
}
|
||||||
@@ -15,9 +16,8 @@ function updateKilometer(km) {
|
|||||||
|
|
||||||
function UpdateTotalPrice() {
|
function UpdateTotalPrice() {
|
||||||
var TotalPrice = +lastKilometer * + price;
|
var TotalPrice = +lastKilometer * + price;
|
||||||
console.log(+lastKilometer * + price);
|
|
||||||
TOTAL_PRICE.innerHTML = Math.floor(TotalPrice).toString();
|
TOTAL_PRICE.innerHTML = Math.floor(TotalPrice).toString();
|
||||||
//mp.trigger("CEF:updateLastPrice", Math.floor(TotalPrice), Math.round((lastKilometer + Number.EPSILON) * 1000) / 1000);
|
mp.trigger("CEF:updateLastPrice", Math.floor(TotalPrice), Math.round((lastKilometer + Number.EPSILON) * 1000) / 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateFarePrice() {
|
function updateFarePrice() {
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ import smoothThrottle from './vehiclesync/smoothtrottle';
|
|||||||
smoothThrottle();
|
smoothThrottle();
|
||||||
|
|
||||||
import vehicleIndicators from './vehiclesync/vehicleindicators';
|
import vehicleIndicators from './vehiclesync/vehicleindicators';
|
||||||
vehicleIndicators();
|
vehicleIndicators();
|
||||||
|
|
||||||
import reportList from './Player/reportmenu';
|
import reportList from './Player/reportmenu';
|
||||||
reportList(globalData);
|
reportList(globalData);
|
||||||
|
|||||||
Reference in New Issue
Block a user