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\modules\items\client.lua

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

and this into: ox_inventory\data\items.lua

['vehiclekeys'] = {
    label = 'Vehicle Keys',
    weight = 10,
    stack = false,
    close = true,
},
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

New:
else if (itemData.name == "vehiclekeys") {
    return `
        <p><strong>${itemData.info.label}</strong></p>
        <p><strong>Model: </strong><span>${itemData.info.model}</span></p>
        <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>
    `;
}


Old:
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

New:
else if (itemData.name == "vehiclekeys") {
    return `
        <p><strong>${itemData.info.label}</strong></p>
        <p><strong>Model: </strong><span>${itemData.info.model}</span></p>
        <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>
    `;
}


Old:
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>"
	);
}
ps

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 to: ps-inventory/html/js/app.js

New:
else if (itemData.name == "vehiclekeys") {
    return `
        <p><strong>${itemData.info.label}</strong></p>
        <p><strong>Model: </strong><span>${itemData.info.model}</span></p>
        <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>
    `;
}


Old:
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>"
	);
}
codem

Add the following into: codem-inventory\config\itemlist.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',
},
core

Add the following into your database:

INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`, `desc`) VALUES
    ('vehiclekeys', 'Vehicle Keys', 1, 0, 1, NULL);
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. Add the following into your database:

    CREATE TABLE IF NOT EXISTS `vehicle_keys` (
         `id` INT(11) NOT NULL AUTO_INCREMENT,
         `vehId` VARCHAR(50) NULL DEFAULT NULL COMMENT 'num or society (Universal key)' COLLATE 'utf8mb4_general_ci',
         `isActive` TINYINT(4) NOT NULL DEFAULT '1',
         `isStored` TINYINT(4) NOT NULL DEFAULT '0',
       PRIMARY KEY (`id`) USING BTREE
    );
  3. Restart your inventory script and start fivecode_carkeys, or restart your server.

  4. Enjoy the script!

  5. [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

Was this helpful?