config.lua
A configuration file to set up the script for your needs.
The default config.lua
cs_vehiclerental = {
Locale = "DE",
Framework = "ESX", -- "ESX", "QB", or "CUSTOM"
vehicleKeys = {
activate = true, -- If true, the integrated vehicle key logic will be used for rented vehicles.
defaultKey = "L",
commandName = "lockRentVeh",
playAnimation = true,
dict = "anim@mp_player_intmenu@key_fob@",
anim = "fob_click_fp",
},
hideTimerInPauseMenu = true,
defaultMinutes = 1, -- The default amount of minutes.
CommandSuggestions = true,
Commands = {
["rentmove"] = {
activate = true,
commandName = "rentmove",
},
},
RentalPositions = {
["airportCar"] = { -- A unique name
position = vector3(-1039.1893, -2731.7185, 20.1693),
pedModel = "ig_fbisuit_01",
pedPosition = vector4(-1039.7104, -2731.1140, 19.2144, 214.3437),
tpBack = false, -- If true, the player will be teleported back to the position when the rental time is over.
tpBackWhenDead = false, -- If true, the player will also be telported back, if they are dead
tpBackPassengers = true, -- If true, all the current passengers of the rented vehicle will be teleported back as well.
marker = {
type = 21,
distance = 10,
bobUpAndDown = false,
faceCamera = false,
rotate = true,
rgba = { r = 26, g = 150, b = 207, a = 140 },
scale = vector3(0.5, 0.5, 0.5)
},
blip = {
active = true, -- True or false, to activate or deactivate the blip
label = "Car rental",
sprite = 225,
color = 18,
scale = 0.7
},
plate = "Car Rent",
vehicles = {
["adder"] = { -- The key is the spawn name of the vehicle
label = "Adder",
desc = "Supersport",
pricePerMinute = 40,
maxPossibleMinutes = 60,
img = "assets/img/vehicles/adder.png",
colors = {
{ r = 26, g = 150, b = 207 },
{ r = 100, g = 150, b = 207 },
{ r = 200, g = 150, b = 207 },
}
},
["blista"] = { -- The key is the spawn name of the vehicle
label = "Blista",
desc = "Coupé",
pricePerMinute = 10,
maxPossibleMinutes = 100,
img = "assets/img/vehicles/blista.png",
colors = {
{ r = 220, g = 20, b = 60 }, -- Red
{ r = 26, g = 150, b = 207 }, -- Blue
{ r = 0, g = 0, b = 0 }, -- Black
{ r = 255, g = 255, b = 255 }, -- White
{ r = 60, g = 179, b = 113 }, -- Green
{ r = 255, g = 215, b = 0 }, -- Gold
{ r = 255, g = 140, b = 0 }, -- Orange
{ r = 147, g = 112, b = 219 }, -- Purple
{ r = 169, g = 169, b = 169 }, -- Grey
{ r = 160, g = 82, b = 45 } -- Brown
}
},
},
spawnPoints = {
vector4(-1037.0442, -2727.0964, 20.1291, 236.9453),
vector4(-1027.0131, -2732.9524, 20.1264, 241.1186),
}
},
["boat"] = {
position = vector3(1529.8801, 3778.2896, 34.5114),
pedModel = "mp_m_boatstaff_01",
pedPosition = vector4(1529.5204, 3778.8677, 33.5114, 216.7728),
tpBack = true, -- If true, the player will be teleported back to the position when the rental time is over.
tpBackWhenDead = false, -- If true, the player will also be telported back, if they are dead
marker = {
type = 21,
distance = 10,
bobUpAndDown = false,
faceCamera = false,
rotate = true,
rgba = { r = 26, g = 150, b = 207, a = 140 },
scale = vector3(0.5, 0.5, 0.5)
},
blip = {
active = true, -- True or false, to activate or deactivate the blip
label = "Boat rental",
sprite = 404,
color = 18,
scale = 0.7
},
plate = "Boat Rent",
vehicles = {
["longfin"] = { -- The key is the spawn name of the vehicle
label = "Longfin",
desc = "Boat",
pricePerMinute = 30,
maxPossibleMinutes = 60,
img = "assets/img/vehicles/longfin.png",
colors = {
{ r = 220, g = 20, b = 60 }, -- Red
{ r = 26, g = 150, b = 207 }, -- Blue
{ r = 0, g = 0, b = 0 }, -- Black
{ r = 255, g = 255, b = 255 }, -- White
{ r = 60, g = 179, b = 113 }, -- Green
{ r = 255, g = 215, b = 0 }, -- Gold
{ r = 255, g = 140, b = 0 }, -- Orange
{ r = 147, g = 112, b = 219 }, -- Purple
{ r = 169, g = 169, b = 169 }, -- Grey
{ r = 160, g = 82, b = 45 } -- Brown
}
},
},
spawnPoints = {
vector4(1519.8679, 3824.6565, 29.5467, 37.5478),
}
},
["airportPlane"] = {
position = vector3(-941.2389, -2954.6191, 13.9451),
pedModel = "s_m_m_pilot_01",
pedPosition = vector4(-940.8844, -2954.0703, 12.9451, 127.2885),
tpBack = true, -- If true, the player will be teleported back to the position when the rental time is over.
tpBackWhenDead = true, -- If true, the player will also be telported back, if they are dead
tpBackPassengers = true, -- If true, all the current passengers of the rented vehicle will be teleported back as well.
marker = {
type = 21,
distance = 10,
bobUpAndDown = false,
faceCamera = false,
rotate = true,
rgba = { r = 26, g = 150, b = 207, a = 140 },
scale = vector3(0.5, 0.5, 0.5)
},
blip = {
active = true, -- True or false, to activate or deactivate the blip
label = "Plane rental",
sprite = 90,
color = 18,
scale = 0.7
},
plate = "Plane Rent",
vehicles = {
["seabreeze"] = { -- The key is the spawn name of the vehicle
label = "Seabreeze",
desc = "Plane",
pricePerMinute = 200,
maxPossibleMinutes = 60,
img = "assets/img/vehicles/seabreeze.png",
colors = {
{ r = 220, g = 20, b = 60 }, -- Red
{ r = 26, g = 150, b = 207 }, -- Blue
{ r = 0, g = 0, b = 0 }, -- Black
{ r = 255, g = 255, b = 255 }, -- White
{ r = 60, g = 179, b = 113 }, -- Green
{ r = 255, g = 215, b = 0 }, -- Gold
{ r = 255, g = 140, b = 0 }, -- Orange
{ r = 147, g = 112, b = 219 }, -- Purple
{ r = 169, g = 169, b = 169 }, -- Grey
{ r = 160, g = 82, b = 45 } -- Brown
}
},
},
spawnPoints = {
vector4(-960.7491, -2965.6079, 13.9453, 75.6094),
vector4(-944.2250, -2977.9062, 13.9451, 100.2292),
}
},
},
GeneralMarker = {
type = 21,
distance = 10,
bobUpAndDown = false,
faceCamera = false,
rotate = true,
rgba = { r = 255, g = 150, b = 207, a = 140 },
scale = vector3(0.5, 0.5, 0.5)
},
}
function Notification(title, msg, type)
exports['cs_hud']:showNotification(title, msg, type, 10000)
end
function HelpNotification(msg)
ESX.ShowHelpNotification(msg)
end
NotifyTypes = {
["info"] = "info",
["error"] = "error",
["success"] = "success",
["warning"] = "warning",
}
LocalesRental = {
['EN'] = {
["openMessage"] = "Press E to open the vehicle rental",
["vehicleRental"] = "Vehicle Rental",
["RemainingTime"] = "Time Remaining:",
-- UI Locales
["serverName"] = "CORECITY",
["serverSecName"] = "Vehicle Rental",
["rentalDesc"] = "Here you can rent vehicles for a certain amount of time.",
["currency"] = "$",
["selectVehicle"] = "Select Vehicle",
["perMinute"] = "/ Minute",
["total"] = "Total",
["renting"] = "Renting",
["time"] = "Time",
["vehicle"] = "Vehicle",
["color"] = "Color",
["rentVehicle"] = "Rent Vehicle",
["timeLeft"] = "TIME LEFT",
["minutes"] = "Minutes",
["minute"] = "Minute",
-- Notifications
["NotEnoughMoney"] = "You do not have enough money!",
["NoFreeSpawnPoint"] = "There is no free spawnpoint available!",
["AlreadyRenting"] = "You are already renting a vehicle!",
["rentedVeh"] = "You have rented a vehicle for %s minute/s.",
["rentalOver"] = "Your rent time is over.",
["vehicleLocked"] = "You locked the vehicle.",
["vehicleUnlocked"] = "You unlocked the vehicle.",
-- Webhooks
["playerRentedVehicle"] = "A player rented a vehicle",
["playerRentedVehicleMsg"] = "**%s** rented **%s** at **%s** for **%s** minute/s.",
["playerRentalOver"] = "A player rent is over",
["playerRentalOverMsg"] = "The rent of **%s** by **%s** at **%s** for **%s** minute/s just ended.",
["playerLeft"] = "A player left while renting",
["playerLeftMsg"] = "**%s** left the server while renting **%s** at **%s** for **%s** minute/s.",
},
['DE'] = {
["openMessage"] = "Drücke E, um die Fahrzeugvermietung zu öffnen",
["vehicleRental"] = "Fahrzeugvermietung",
["RemainingTime"] = "Verbleibende Zeit:",
-- UI Locales
["serverName"] = "CORECITY",
["serverSecName"] = "Fahrzeugvermietung",
["rentalDesc"] = "Hier kannst du Fahrzeuge für eine bestimmte Zeit mieten.",
["currency"] = "€",
["selectVehicle"] = "Fahrzeug auswählen",
["perMinute"] = "/ Minute",
["total"] = "Gesamt",
["renting"] = "Miet",
["time"] = "Zeit",
["vehicle"] = "Fahrzeug",
["color"] = "Farbe",
["rentVehicle"] = "Fahrzeug mieten",
["timeLeft"] = "MIETZEIT",
["minutes"] = "Minuten",
["minute"] = "Minute",
-- Notifications
["NotEnoughMoney"] = "Du hast nicht genug Geld!",
["NoFreeSpawnPoint"] = "Es ist kein freier Spawnpunkt verfügbar!",
["AlreadyRenting"] = "Du mietest bereits ein Fahrzeug!",
["rentedVeh"] = "Du hast ein Fahrzeug für %s Minute(n) gemietet.",
["rentalOver"] = "Deine Mietzeit ist abgelaufen.",
["vehicleLocked"] = "Du hast das Fahrzeug abgeschlossen.",
["vehicleUnlocked"] = "Du hast das Fahrzeug aufgeschlossen.",
-- Webhooks
["playerRentedVehicle"] = "Ein Spieler hat ein Fahrzeug gemietet",
["playerRentedVehicleMsg"] = "**%s** hat **%s** bei **%s** für **%s** Minute(n) gemietet.",
["playerRentalOver"] = "Die Fahrzeugmiete eines Spielers ist beendet",
["playerRentalOverMsg"] = "Die Miete von **%s** durch **%s** bei **%s** für **%s** Minute(n) ist gerade abgelaufen.",
["playerLeft"] = "Ein Spieler hat den Server während der Miete verlassen",
["playerLeftMsg"] = "**%s** hat den Server verlassen, während er **%s** bei **%s** für **%s** Minute(n) gemietet hatte.",
},
}
Vehicle Rental Config.lua Guide
The script is developed for servers using frameworks such as ESX, QB, or custom setups.
Here are the main components:
General Configuration
Locale: Language settings, with support for English (
EN
) and German (DE
).Framework: Supported frameworks are
ESX
,QB
, orCUSTOM
.Vehicle Keys: Enable or disable key management with default key as "L".
Features
Timer Visibility: Hide the rental timer in the pause menu.
Default Rental Time: Sets the default rental time to 1 minute.
Commands: Enable and define commands such as
rentmove
.
Rental Locations
Each rental spot has a unique setup:
Location Specifics:
Coordinates for rental positions and NPC models.
Teleport options when time expires or when players are dead.
Marker and Blip Settings:
Customize markers and blips for visibility and interactivity at each rental point.
Vehicle Options:
Descriptions, pricing, and available colors for vehicles per location.
Notification System
Use your notification script for displaying notifications.
Localization
Text strings and messages are available in English and German. More languages can be added using copy and paste.
Last updated
Was this helpful?