Finish WeaponDeal System - Improved Inventory

This commit is contained in:
Lukas Moungos
2019-10-29 17:05:14 +01:00
parent 9ec30fd419
commit 55e0c4005e
9 changed files with 357 additions and 89 deletions

View File

@@ -4,26 +4,32 @@
* @copyright (c) 2008 - 2018 Life of German
*/
export default function playerList() {
export default function playerList(globalData: GlobalData) {
var playerlistBrowser
var playerlistBrowser: BrowserMp = null;
var pList;
mp.events.add("showPlayerlist", (playersJson) => {
if (!playerlistBrowser) {
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 {
if (playerlistBrowser == null) {
if (!globalData.InMenu) {
globalData.InMenu = 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)}');`);
});
}
} else {
playerlistBrowser.destroy();
playerlistBrowser = null;
mp.gui.chat.activate(true);
mp.gui.cursor.show(false, false);
globalData.InMenu = false;
}
});
mp.events.add("CEF:fetchPlayerList", () => {