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

@@ -78,14 +78,45 @@ export default function inventory(globalData: GlobalData): void {
});
mp.events.add("CEF:invThrowItem", (itemId, amount) => {
mp.events.callRemote('invThrowItem', itemId, amount);
});
mp.events.add("CEF:throwItem", (type, amount, id) => {
mp.events.add("CEF:useItem", (type, amount, id) => {
mp.events.callRemote("itemInteract", type, amount, id);
});
mp.events.add("removeItem", (id, amount) => {
if (invBrowser !== null) {
invBrowser.execute(`removeItems('${JSON.stringify(id)}','${JSON.stringify(amount)}')`);
}
});
mp.events.add("aproveUse", (amount, name) => {
if (invBrowser !== null) {
mp.game.audio.playSoundFrontend(1, "LOCAL_PLYR_CASH_COUNTER_COMPLETE", "DLC_HEISTS_GENERAL_FRONTEND_SOUNDS", true);
invBrowser.execute(`alertGreen('${JSON.stringify(amount)}','${JSON.stringify(name)}')`);
}
});
mp.events.add("aproveThrow", (amount, name) => {
if (invBrowser !== null) {
mp.game.audio.playSoundFrontend(1, "ERROR", "HUD_AMMO_SHOP_SOUNDSET", true);
invBrowser.execute(`alertRed('${JSON.stringify(amount)}','${JSON.stringify(name)}')`);
}
});
mp.events.add("aproveTransfer", (amount, name, where) => {
if (invBrowser !== null) {
mp.game.audio.playSoundFrontend(1, "ERROR", "HUD_AMMO_SHOP_SOUNDSET", true);
invBrowser.execute(`alertBlue('${JSON.stringify(amount)}','${JSON.stringify(name)}','${JSON.stringify(where)}')`);
}
});
mp.events.add("Error", (msg) => {
if (invBrowser !== null) {
mp.game.audio.playSoundFrontend(1, "ERROR", "HUD_AMMO_SHOP_SOUNDSET", true);
invBrowser.execute(`alertError('${JSON.stringify(msg)}')`);
}
});
mp.events.add("CEF:InventoryLoaded", () => {
if (offer == 1) {
invBrowser.execute(`changeTradeStatus('${JSON.stringify(offer)}')`);
@@ -101,6 +132,7 @@ export default function inventory(globalData: GlobalData): void {
mp.events.callRemote('getNearVehicles');
});
mp.events.add("CEF:acceptTrade", () => {
if (invBrowser !== null) {
mp.events.callRemote('acceptTrade');