Installation Guide

Follow these steps for flawless instalation:

  1. Download the script from your keymaster.

  2. Place the script into your server resource folder: FXServer\server-data\resources\fivecode_carkeys

  3. Write the script into your server.cfg: ensure fivecode_carkeys

  4. Setup your inventory - ox, qb, qs, aq:

ox

Add the following into: ox_inventory\data\items.lua

['vehiclekeys'] = {
    label = 'Vehicle Keys',
    weight = 10,
    stack = false,
    close = true,
},

and this into: ox_inventory\modules\items\client.lua

Item('vehiclekeys', function(data, slot)
    TriggerServerEvent('fivecode_carkeys:useKeys', slot.metadata)
end)
qb

Add the following into: qb-core\shared\items.lua

['vehiclekeys'] = {
	['name'] = 'vehiclekeys',
	['label'] = 'Vehicle Keys',
	['weight'] = 50,
	['type'] = 'item',
	['image'] = 'vehiclekeys.png',
	['unique'] = true,
	['useable'] = true,
	['shouldClose'] = true,
	['combinable'] = nil,
	['description'] = 'Advanced Vehicle Keys',
},

and this into: qb-inventory/html/js/app.js

else if (itemData.name == "vehiclekeys") {
        $(".item-info-title").html("<p>" + itemData.info.label + "</p>");
        $(".item-info-description").html(
                "<p><strong>Model: </strong><span>" +
                itemData.info.model +
                "<p><strong>Plate: </strong><span>" +
                itemData.info.plate +
                "</span></p><p><strong>VIN: </strong><span>" +
                itemData.info.vin +
                "</span></p><p><strong>Security key: </strong><span>" +
                itemData.info.key +
                "</span></p>"
	);
}
qs

Add the following into: qs-inventory\shared\items.lua

['vehiclekeys'] = {
	['name'] = 'vehiclekeys',
	['label'] = 'Vehicle Keys',
	['weight'] = 50,
	['type'] = 'item',
	['image'] = 'vehiclekeys.png',
	['unique'] = true,
	['useable'] = true,
	['shouldClose'] = true,
	['combinable'] = nil,
	['description'] = 'Advanced Vehicle Keys',
},

and this into: qs-inventory\config\metadata.js

else if (itemData.name == "vehiclekeys") {
        $(".item-info-title").html("<p>" + itemData.info.label + "</p>");
        $(".item-info-description").html(
                "<p><strong>Model: </strong><span>" +
                itemData.info.model +
                "<p><strong>Plate: </strong><span>" +
                itemData.info.plate +
                "</span></p><p><strong>VIN: </strong><span>" +
                itemData.info.vin +
                "</span></p><p><strong>Security key: </strong><span>" +
                itemData.info.key +
                "</span></p>"
	);
}
aq

It is necessary to modify the export statement below: aq-inventory/server/events/events.lua

-- from:
exports[resource][func](source, item)
-- to:
exports[resource][func](nil, source, item)

and this into: aq-inventory\shared\items/items.lua

ScriptShared.Items:Add("vehiclekeys", {
    stackable = false,
    deletable = true,
    tradable = true,
    label = "Vehicle Keys",
    weight = 0.1,
    category = "Raw Material",
    server = {
        export = "fivecode_carkeys:useKeys"
    }
})
  1. Configure everything to your liking in Config.lua.

  2. Restart your inventory script and start fivecode_carkeys, or restart your server.

  3. Enjoy the script!

  4. [Optional] If you want to have item image in your inventory, place the image bellow here: - ox_inventory\web\images - qs-inventory\html\images - qb-inventory\html\images - aq-inventory\html\items

If you need help with anything else, do not hesitate and open a support ticket in our discord.

Last updated