qb-inventory

Supports qb-inventory 2.0.0+

  1. Replace generateTooltipContent function in qb-inventory/html/app.js with the following:


generateTooltipContent(item) {
            if (!item) {
                return "";
            }
        
            const itemLabel = item.info && item.info.label ? item.info.label : item.label;
        
            let content = `<div class="custom-tooltip"><div class="tooltip-header">${itemLabel}</div><hr class="tooltip-divider">`;
            const description = item.info && item.info.description 
                ? item.info.description.replace(/\n/g, "<br>") 
                : item.description 
                ? item.description.replace(/\n/g, "<br>") 
                : "No description available.";
        

        

            if (item.info && Object.keys(item.info).length > 0) {
                for (const [key, value] of Object.entries(item.info)) {
                    
                    if (item.name === "5g_adapter" && (key === "assignedSim" || key === "usageCount" || key === "label")) {
                        continue; 
                    }
        
                    if (item.name === "written_sim" && (key === "payoutValue" || key === "name_registered" || key === "label")) {
                        continue;
                    }
        
                    if (item.name === "written_card" && (key === 'label')) {
                        continue;
                    }

                    if (typeof value === "object") {
                        continue;
                    }
        
                    let valueStr = value;
        
                    // Special handling for "attachments" field
                    if (key === "attachments") {
                        valueStr = Object.keys(value).length > 0 ? "true" : "false";
                    }
        
                    content += `<div class="tooltip-info"><span class="tooltip-info-key">${this.formatKey(key)}:</span> ${valueStr}</div>`;
                }
            }
        
            content += `<div class="tooltip-description">${description}</div>`;
            content += `<div class="tooltip-weight"><i class="fas fa-weight-hanging"></i> ${item.weight !== undefined && item.weight !== null ? (item.weight / 1000).toFixed(1) : "N/A"}kg</div>`;
        
            content += `</div>`;
            return content;
        },
        
  1. Install the following items into qb-core/shared/items.lua


fraud_laptop = { name = 'fraud_laptop', label = 'Fraud Laptop', weight = 2000, type = 'item', image = 'fraud_laptop.png', unique = false, useable = true, shouldClose =  true, combinable = nil, description = 'A basic laptop' },
trap_phone = { name = 'trap_phone', label = 'Trap Phone', weight = 500, type = 'item', image = 'trap_phone.png', unique = false, useable = true, shouldClose =  true, combinable = nil, description = 'A basic phone' },

blank_card = { name = 'blank_card', label = 'Blank Card', weight = 10, type = 'item', image = 'blank_card.png', unique = false, useable = true, shouldClose =  true, combinable = nil, description = 'A blank card' },
written_card = { name = 'written_card', label = 'Written Card', weight = 10, type = 'item', image = 'written_card.png', unique = true, useable = false, shouldClose = false, combinable = nil, description = 'A written card with someones data' },
    
blank_sim= { name = 'blank_sim', label = 'Blank SIM', weight = 10, type = 'item', image = 'blank_sim.png', unique = false, useable = true, shouldClose =  true, combinable = nil, description = 'A blank SIM' },
written_sim = { name = 'written_sim', label = 'Written SIM', weight = 10, type = 'item', image = 'written_sim.png', unique = true, useable = false, shouldClose = false, combinable = nil, description = 'A written SIM with someones data' },
    
card_writer = { name = 'card_writer', label = 'Card Writer', weight = 1, type = 'item', image = 'card_writer.png', unique = false, useable = true, shouldClose =  true, combinable = nil, description = 'A card reader/writer' },
wifi_adapter = { name = 'wifi_adapter', label = 'WiFi Adapter', weight = 1, type = 'item', image = 'wifi_adapter.png', unique = false, useable = true, shouldClose =  true, combinable = nil, description = 'A WiFi module for connecting to the internet' },   
['5g_adapter'] = { name = '5g_adapter', label = '5G Adapter', weight = 1, type = 'item', image = '5g_adapter.png', unique = true, useable = true, shouldClose =  true, combinable = nil, description = 'A 5G module for connecting to the internet' },
  1. Drag all the images from item_images into qb-inventory/html/images

Last updated