Finish Inventory-Backend

This commit is contained in:
VegaZ
2018-12-10 21:27:16 +01:00
parent f783a889c7
commit e10f89ea69
3 changed files with 57 additions and 27 deletions

View File

@@ -54,7 +54,7 @@ mp.events.add("showInventory", (invWeight, itemArr) => {
show = true;
mp.game.graphics.requestStreamedTextureDict("itemimages", true);
} else {
mp.events.callRemote('saveInventory', items);
mp.events.callRemote('saveInventory', JSON.stringify(items));
mp.gui.chat.activate(true);
mp.gui.cursor.show(false, false);
show = false;
@@ -62,6 +62,10 @@ mp.events.add("showInventory", (invWeight, itemArr) => {
}
});
mp.events.add("addItem", (item) => {
items.push(item);
});
mp.events.add("render", () => {
if (show === true) {
var pos = mp.gui.cursor.position;