🏎️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:
array
name:
string
The name of the ganggrade:
number
The grade of the gang
job:
table
type:
string
The type of the job (e.g., 'mechanic')grade:
number
The grade of the job
blip:
table
use:
boolean
Whether to use the blip (true/false)sprite:
number
The sprite ID for the blipcolor:
number
The color ID for the blipscale:
number
The scale of the bliplabel:
number
The label for the blip
warpPlayer:
boolean
Warps the player into the vehicleicon:
string
The icon for the rental location (FontAwesome icon class)ped:
table
model:
hash
The model hash for the NPCcoords:
vector4
The coordinates and heading for the NPC (vector4)scenario:
string
The scenario the NPC will perform
vehicles:
table
hash:
hash
The vehicle hashrentalCost:
number
The price of the vehicle rentalminRentalDays:
number
The minimum rental daysmaxRentalDays:
number
The maximum rental daysfuelLevel:
number
The fuel level of the vehicleimage:
string
The image URL of the vehicle
coords:
table
List of coordinates for vehicle spawn points (vector4)
Last updated