Add Taximeter

This commit is contained in:
Siga
2020-03-01 17:39:54 +01:00
parent edf06f4478
commit fb527f8c57
21 changed files with 404 additions and 56 deletions

View File

@@ -10,24 +10,24 @@ export default function playerList(globalData: GlobalData): void {
var pList;
mp.events.add("showPlayerlist", (playersJson) => {
if (!globalData.InMenu) {
if (playerlistBrowser === null) {
playerlistBrowser = mp.browsers.new('package://assets/html/Playerlist/Tabliste.html');
mp.gui.chat.activate(false);
mp.gui.cursor.show(true, true);
pList = JSON.parse(playersJson);
pList.forEach((player) => {
playerlistBrowser.execute(`ad_row('${JSON.stringify(player.Id)}','${JSON.stringify(player.Name)}',0,0,'${JSON.stringify(player.Ping)}');`);
});
} else {
playerlistBrowser.destroy()
playerlistBrowser = null;
mp.gui.cursor.show(false, false);
mp.gui.chat.activate(true);
}
if (playerlistBrowser === null) {
playerlistBrowser.destroy()
playerlistBrowser = null;
globalData.InInput = false;
mp.gui.cursor.show(false, false);
mp.gui.chat.activate(true);
}
if (!globalData.InInput) {
globalData.InInput = true;
playerlistBrowser = mp.browsers.new('package://assets/html/Playerlist/Tabliste.html');
mp.gui.chat.activate(false);
mp.gui.cursor.show(true, true);
pList = JSON.parse(playersJson);
pList.forEach((player) => {
playerlistBrowser.execute(`ad_row('${JSON.stringify(player.Id)}','${JSON.stringify(player.Name)}',0,0,'${JSON.stringify(player.Ping)}');`);
});
}
});
mp.events.add("CEF:fetchPlayerList", () => {