Installation

Installation Guide

You need msk_core! - Download it here

  • Drag & Drop the folder msk_vehiclekeys into your resource folder

  • Add ensure msk_vehiclekeys in your server.cfg

  • Configure the config.lua

  • Set your current Framework at Config.Framework

  • Set the Hotkeys that you want (Users can change it by themself in fivem keybind settings)

  • Add the itemName in Config.Settings to your inventory or database

  • Activate or deactivate uniqueItems if your are using one of the supported inventories

MSK VehicleKeys don't need any SQL file. All vehicle keys will be saved in vehiclekeys.json.

Do NOT add or delete anything in vehiclekeys.json! This will be overwritten as the script saves the data every 5 minutes and when the script was stopped.

Supported Inventories

Supported Inventories for Unique Items are:

  • ox_inventory

  • qs-inventory

  • core_inventory

We have no plans to support further inventories.

We recommend using ox_inventory for Unique Items because with this inventory we can Add or Remove the Players Key automatically if he Drops, Give, etc. the Key Item (except TempKeys).

With other inventories that's currently not possible! You can find the code for that in server/main.lua, maybe you can add that yourself...

Items

There are 2 different items that you need to add to your inventory or database. You can change them in config.lua if you want to give them a different name.

  • keys - The Vehicle Key Item

  • contract - Item to sell your vehicle to antoher player

ox_inventory
["keys"] = {
    label = "Vehicle Key",
    weight = 35,
    stack = false,
    close = true,
    client = {
        export = 'msk_vehiclekeys.toggleLock'
    },
},

["contract"] = {
    label = "Contract",
    weight = 1,
    stack = true,
    close = true,
    client = {
        export = 'msk_vehiclekeys.openDialog'
    },
},
qs-inventory
  • Go to qs-inventory\config\metadata.js

  • Go to line ~54 and insert the following:

} else if (itemData.name == "keys") { 
    $(".item-info-title").html("<p>" + label + "</p>");
    $(".item-info-description").html(
        itemData.info.description +
        "</span></p>"
    );
}
  • It should look like this:

} else if (itemData.name == "tradingcard_psa") {
    $(".item-info-title").html("<p>" + label + "</p>");
    $(".item-info-description").html(
        "<p><strong>PSA ID: </strong><span>" +
        itemData.info.serial +
        "</span></p>"
    );
 } else if (itemData.name == "keys") {
    $(".item-info-title").html("<p>" + label + "</p>");
    $(".item-info-description").html(
        itemData.info.description +
        "</span></p>"
    );
} else if (itemData.name == "photo") {
    $(".item-info-title").html("<p>" + `${itemData.info.label || label}` + "</p>");
    $(".item-info-description").html(
        "<p><span>" +
        itemData.info.location +
        "</span></p><span>" +
        itemData.info.date + "</span></p>"
    );
}
  • Then go to qs-inventory\shared\items.lua and insert the keys item

['keys'] = { -- must be the same as in your msk_vehiclekeys config.lua (itemName = 'keys',) 
    ['name'] = 'keys', -- must be the same as in your msk_vehiclekeys config.lua (itemName = 'keys',) 
    ['label'] = 'Vehicle Key',
    ['weight'] = 35,
    ['type'] = 'item',
    ['image'] = 'keys.png',
    ['unique'] = true,
    ['useable'] = true,
    ['shouldClose'] = true,
    ['combinable'] = nil,
    ['description'] = nil
},

['contract'] = { -- must be the same as in your msk_vehiclekeys config.lua (itemName = 'contract',) 
    ['name'] = 'contract', -- must be the same as in your msk_vehiclekeys config.lua (itemName = 'contract',) 
    ['label'] = 'Contract',
    ['weight'] = 1,
    ['type'] = 'item',
    ['image'] = 'contract.png',
    ['unique'] = false,
    ['useable'] = true,
    ['shouldClose'] = true,
    ['combinable'] = nil,
    ['description'] = 'Contract to sell your vehicle'
},

Last updated