🏎️Vehicle Rentals

Sql
There are 2 sql files included, the file named Sql is just the entire qb/qbx-garages sql updated with my additions.The other is the sql that would alter the current database table to include my additions. (just felt to include both for whatever reason).

Ox Inventory
Add the following in ox_inventory > data > items.lua
["rental_paper"] = {
label = "Rental Paper",
weight = 0,
stack = false,
close = true,
description = 'Proof of rental agreement',
},Item Images
Copy the image/s within kevin-rentals > images
Paste the image/s in ox_inventory > web > images
QB Inventory
Add the following to qb-core > shared > items.lua
rental_paper = { name = 'rental_paper', label = 'Rental Paper', weight = 0, type = 'item', image = 'rental_paper.png', unique = true, useable = true, shouldClose = true, description = 'Proof of rental agreement' },
PS Inventory
If using ps inventory add the following snippet in ps-inventory > js > app.js around line 449
} else if (itemData.name == "rental_paper") {
$(".item-info-title").html("<p>" + itemData.label + "</p>");
$(".item-info-description").html(
"<p><strong>Owner: </strong><span>" +
(itemData.info.owner || "Unknown") +
"</span></p><p><strong>Plate: </strong><span>" +
(itemData.info.plate || "N/A") +
"</span></p><p><strong>Vehicle: </strong><span>" +
(itemData.info.vehicle || "N/A") +
"</span></p><p><strong>Rental Date: </strong><span>" +
(itemData.info.date || "N/A") +
"</span></p><p><strong>Duration: </strong><span>" +
(itemData.info.duration || "N/A") +
"</span></p>"
);Item Images
Copy the image/s within kevin-rentals > images
Paste the images in qb inventory > html > images
Creating new locations
-- Example of a rental location created for mechanics
{
job = {
type = 'mechanic',
grade = 1
},
blip = {
use = true,
sprite = 560,
color = 83,
scale = 0.8,
label = 'LS Mechanic Rentals',
},
icon = 'fa-solid fa-tools',
ped = {
model = `s_m_y_xmech_01`,
coords = vector4(420.9, -1632.64, 29.25, 108.42),
scenario = 'WORLD_HUMAN_CLIPBOARD',
},
vehicles = {
{
hash = `towtruck`,
rentalCost = 120,
minRentalDays = 1,
maxRentalDays = 7,
fuelLevel = 100.0,
image = 'https://r2.fivemanage.com/CikOOzU9PmR8OMM0GvFLL/image/towtruck.png' -- The image of the vehicle
},
},
coords = {
vector4(419.17, -1629.9, 29.26, 320.22),
vector4(416.74, -1628.19, 29.26, 319.72),
}
},gang:
arrayname:
stringThe name of the ganggrade:
numberThe grade of the gang
job:
tabletype:
stringThe type of the job (e.g., 'mechanic')grade:
numberThe grade of the job
blip:
tableuse:
booleanWhether to use the blip (true/false)sprite:
numberThe sprite ID for the blipcolor:
numberThe color ID for the blipscale:
numberThe scale of the bliplabel:
numberThe label for the blip
warpPlayer:
booleanWarps the player into the vehicleicon:
stringThe icon for the rental location (FontAwesome icon class)ped:
tablemodel:
hashThe model hash for the NPCcoords:
vector4The coordinates and heading for the NPC (vector4)scenario:
stringThe scenario the NPC will perform
vehicles:
tablehash:
hashThe vehicle hashrentalCost:
numberThe price of the vehicle rentalminRentalDays:
numberThe minimum rental daysmaxRentalDays:
numberThe maximum rental daysfuelLevel:
numberThe fuel level of the vehicleimage:
stringThe image URL of the vehicle
coords:
tableList of coordinates for vehicle spawn points (vector4)
Exports
Checks if a vehicle is a rental vehicle and returns a boolean
exports['kevin-rentals']:isRentalVehicle(plate, hash)Useage
-- Export Useage [client/server]
local isRental = exports['kevin-rentals']:isRentalVehicle('45IRT635', `75131841`)
if isRental then
print('This vehicle is a rental and cant be sold')
return
endLast updated