Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- This is for html/css/ui.css
- #playerInventoryFastItems {
- width: 370px;
- height: 50px;
- position : absolute;
- bottom : -9.4%;
- right:-1%;
- z-index: 100;
- float:left;
- }
- This is for html/js/inventory.js : https://gyazo.com/8ac210b0a423417fa61c87c0de929957
- $("#playerInventoryFastItems").html("");
- var i;
- for (i = 1; i < 4 ; i++) {
- $("#playerInventoryFastItems").append('<div class="slotFast"><div id="itemFast-' + i + '" class="item" >' +
- '<div class="keybind">' + i + '</div><div class="item-count"></div> <div class="item-name"></div> </div ><div class="item-name-bg"></div></div>');
- }
- $.each(fastItems, function (index, item) {
- count = setCount(item);
- $('#itemFast-' + item.slot).css("background-image",'url(\'img/items/' + item.name + '.png\')');
- $('#itemFast-' + item.slot).html('<div class="keybind">' + item.slot + '</div><div class="item-count">' + count + '</div> <div class="item-name">' + item.label + '</div> <div class="item-name-bg"></div>');
- $('#itemFast-' + item.slot).data('item', item);
- $('#itemFast-' + item.slot).data('inventory', "fast");
- });
- makeDraggables()
- This is for html/ui.html : https://gyazo.com/aa06e09bbc98a5d78f42ad254df09e0d
- </div>
- <div id="playerInventoryFastItems">
- </div>
- This is for html/js/inventory.js : https://gyazo.com/976cd54ded1081a62cbff7c5247a1400
- inventorySetup(event.data.itemList,event.data.fastItems);
- This is for html/js/inventory.js : https://gyazo.com/78656c10b8f07637c0f3f3da53f86208
- function inventorySetup(items,fastItems) {
- $("#playerInventory").html("");
- $.each(items, function (index, item) {
- count = setCount(item);
- $("#playerInventory").append('<div class="slot"><div id="item-' + index + '" class="item" style = "background-image: url(\'img/items/' + item.name + '.png\')">' +
- '<div class="item-count">' + count + '</div> <div class="item-name">' + item.label + '</div> </div ><div class="item-name-bg"></div></div>');
- $('#item-' + index).data('item', item);
- $('#item-' + index).data('inventory', "main");
- });
- $("#playerInventoryFastItems").html("");
- var i;
- for (i = 1; i < 4 ; i++) {
- $("#playerInventoryFastItems").append('<div class="slotFast"><div id="itemFast-' + i + '" class="item" >' +
- '<div class="keybind">' + i + '</div><div class="item-count"></div> <div class="item-name"></div> </div ><div class="item-name-bg"></div></div>');
- }
- $.each(fastItems, function (index, item) {
- count = setCount(item);
- $('#itemFast-' + item.slot).css("background-image",'url(\'img/items/' + item.name + '.png\')');
- $('#itemFast-' + item.slot).html('<div class="keybind">' + item.slot + '</div><div class="item-count">' + count + '</div> <div class="item-name">' + item.label + '</div> <div class="item-name-bg"></div>');
- $('#itemFast-' + item.slot).data('item', item);
- $('#itemFast-' + item.slot).data('inventory', "fast");
- });
- makeDraggables()
- }
- function makeDraggables(){
- $('#itemFast-1').droppable({
- drop: function (event, ui) {
- itemData = ui.draggable.data("item");
- itemInventory = ui.draggable.data("inventory");
- if (type === "normal" && (itemInventory === "main" || itemInventory === "fast") && itemData.type === "item_weapon") {
- disableInventory(500);
- $.post("http://esx_inventoryhud/PutIntoFast", JSON.stringify({
- item: itemData,
- slot : 1
- }));
- }
- }
- });
- $('#itemFast-2').droppable({
- drop: function (event, ui) {
- itemData = ui.draggable.data("item");
- itemInventory = ui.draggable.data("inventory");
- if (type === "normal" && (itemInventory === "main" || itemInventory === "fast") && itemData.type === "item_weapon") {
- disableInventory(500);
- $.post("http://esx_inventoryhud/PutIntoFast", JSON.stringify({
- item: itemData,
- slot : 2
- }));
- }
- }
- });
- $('#itemFast-3').droppable({
- drop: function (event, ui) {
- itemData = ui.draggable.data("item");
- itemInventory = ui.draggable.data("inventory");
- if (type === "normal" && (itemInventory === "main" || itemInventory === "fast") && itemData.type === "item_weapon") {
- disableInventory(500);
- $.post("http://esx_inventoryhud/PutIntoFast", JSON.stringify({
- item: itemData,
- slot : 3
- }));
- }
- }
- });
- }
- function secondInventorySetup(items) {
- $("#otherInventory").html("");
- $.each(items, function (index, item) {
- count = setCount(item);
- $("#otherInventory").append('<div class="slot"><div id="itemOther-' + index + '" class="item" style = "background-image: url(\'img/items/' + item.name + '.png\')">' +
- '<div class="item-count">' + count + '</div> <div class="item-name">' + item.label + '</div> </div ><div class="item-name-bg"></div></div>');
- $('#itemOther-' + index).data('item', item);
- $('#itemOther-' + index).data('inventory', "second");
- });
- }
- function shopInventorySetup(items) {
- $("#otherInventory").html("");
- $.each(items, function (index, item) {
- //count = setCount(item)
- cost = setCost(item);
- $("#otherInventory").append('<div class="slot"><div id="itemOther-' + index + '" class="item" style = "background-image: url(\'img/items/' + item.name + '.png\')">' +
- '<div class="item-count">' + cost + '</div> <div class="item-name">' + item.label + '</div> </div ><div class="item-name-bg"></div></div>');
- $('#itemOther-' + index).data('item', item);
- $('#itemOther-' + index).data('inventory', "second");
- });
- }
- This is for html/js/inventory.js : https://gyazo.com/d9c34bf2ac99b43c0cbf022c7b094291
- }else if (type === "normal" && itemInventory === "fast") {
- disableInventory(500);
- $.post("http://esx_inventoryhud/TakeFromFast", JSON.stringify({
- item: itemData
- }));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement