Rental Paper System

Vehicle Keys integrates a very useful Rental Documents system that can be used through metadata items, this could be used in other assets to give a rental vehicle document.

Is this system mandatory or optional?

This system is completely optional.


Add the rental papers item

Configure the rental papers item name in your script's configuration file (e.g., Config.RentalPaperItem).

This system will depend on an item which we must add to our inventory or SQL.

Items for qs-inventory
['rentalpaper'] = {
    ['name'] = 'rentalpaper',
    ['label'] = 'Rental Paper',
    ['weight'] = 50,
    ['type'] = 'item',
    ['image'] = 'rentalpaper.png',
    ['unique'] = true,
    ['useable'] = true,
    ['shouldClose'] = true,
    ['combinable'] = nil,
    ['description'] = 'A small and sweet casting.'
},

You can add this snippet in config/metadata.js to see the item information, but make sure it is not already added.

if (itemData.name == "rentalpaper") {
  $(".item-info-title").html("<p>Rental Paper</p>");
  $(".item-info-description").html(
      "<p><strong>Owner: </strong><span>" +
      itemData.info.owner +
      "</span></p><p><strong>Plate: </strong><span>" +
      itemData.info.plate +
      "</span></p><p><strong>Vehicle: </strong><span>" +
      itemData.info.vehicle +
      "</span></p>"
  );
}
Items for qb-inventory
rentalpaper 				 = {["name"] = "rentalpaper", 					["label"] = "Rental Paper", 			["weight"] = 50, 		["type"] = "item", 		["image"] = "rentalpaper.png", 			["unique"] = true, 		["useable"] = true, 	["shouldClose"] = true,    ["combinable"] = nil,  ["description"] = "A small and sweet casting."},

You can add this snippet in qb-inventory/html/js/app.js to see the item information, but make sure it is not already added.

case "rentalpaper":
            return `<p>${itemData.label}</p>
            <p><strong>Owner: </strong><span>${itemData.info.plate}</span></p>
            </span></p><p><strong>Plate: </strong><span>${itemData.info.plate}</span></p>
            </span></p><p><strong>Vehicle: </strong><span>${itemData.info.vehicle}</span></p>;
Items for ox_inventory
["rentalpaper"] = {
	label = "Rental Paper",
	weight = 1,
	stack = false,
	close = false,
	consume = 0
},

AddRentalPapers

These exports behave similarly to GiveKeys and RemoveKeys exports.

The function adds rental papers to the player's inventory based on the provided plate and model.

-- plate: The vehicle plate associated with the rental papers
-- model: The vehicle model associated with the rental papers
exports["qs-vehiclekeys"]:AddRentalPapers(plate, model)

RemoveRentalPapers

These exports behave similarly to GiveKeys and RemoveKeys exports.

The function removes rental papers from the player's inventory based on the provided plate and model.

-- plate: The vehicle plate associated with the rental papers
-- model: The vehicle model associated with the rental papers
exports["qs-vehiclekeys"]:RemoveRentalPapers(plate, model)

Last updated