Step 5

Item metadata

This section is exclusively for qs-inventory otherwise ignore it as you will not need to add this information.

This is the metadata of the keys, if you have the latest version of qs-inventory you don't need to add anything

qs-inventory/config/metadata.js
} else if (itemData.name == "vehiclekeys") {
    $(".item-info-title").html("<p>" + itemData.label + "</p>");
    $(".item-info-description").html(
        "<p><strong>Plate: </strong><span>" +
        itemData.info.plate +
        "</span></p><p><strong>Model: </strong><span>" +
        itemData.info.description +
        "</span></p>"
    );
} else if (itemData.name == "plate") {
    $(".item-info-title").html("<p>" + itemData.label + "</p>");
    $(".item-info-description").html(
        "<p><strong>Plate: </strong><span>" +
        itemData.info.plate +
        "</span></p>"
    );

Ignore this if use QS-INVENTORY To qb-inventory and give you the plate item with metadata you have to modify your giveitem command

qb-inventory/server/main.lua
-- Add this before giveitem command
-- Line ~ 2369
function generar_matricula()
	local caracteres = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
	local matricula = ""
	
	for i = 1, 8 do
		local aleatorio = math.random(1, #caracteres)
		matricula = matricula .. caracteres:sub(aleatorio, aleatorio)
	end
	
	return matricula
end

Add this on your GIVEITEM command

elseif itemData["name"] == "plate" then
	info.plate = generar_matricula()

Last updated