TTH_Location is a lightweight and highly optimized FiveM script that integrates a vehicle rental system into your server using ESX and ox_lib. It allows players to rent vehicles (cars, bikes, etc.) seamlessly and efficiently.
Key Highlights:
- Ultra-Optimized Performance: The rental menu operates at a near-zero 0.00 ms impact during regular use. The only minor spike (around 0.01 ms) occurs during the very first vehicle spawn after a server restart, as the engine loads necessary assets. Afterwards, spawns are virtually impact-free.
- No Idle Overhead: The script remains dormant until the rental menu is opened, ensuring no unnecessary background processing.
- Fully Configurable: Easily customize vehicle categories, pricing, and spawn locations via the
config.luafile. - Seamless ESX Integration: Designed to work flawlessly with the ESX framework for handling player transactions and data.
Whether you're running a busy RP server or a small community, TTH_Location delivers an efficient rental experience without compromising performance.
- Vehicle Rental System: Rent cars, bikes, and more directly in-game.
- Customizable Configuration: Tailor vehicle types, prices, and spawn points with ease.
- Dynamic Menu UI: Powered by ox_lib, offering a modern and interactive interface.
- Optimized Performance: Maintains near-zero resource usage during normal operation.
- Seamless ESX Integration: Handles billing and player data reliably.
This script requires the following dependencies:
- ox_lib
- oxmysql
- es_extended
- OneSync (required for optimal entity handling)
Follow these steps to install TTH_Location:
-
Download the latest release of the script.
-
Extract the files to a location on your PC.
-
Rename the folder to remove the
main-prefix, if present. -
Place the script in your resources folder within your FiveM server directory.
-
Add the following line to your
server.cfgorresources.cfgfile:ensure TTH_Location
-
Restart your server.
-
Enjoy the seamless vehicle rental functionality in-game!
Customize the script through the config.lua file:
Config = {}
Config.Cars = {
vehicles = {
{ model = 'adder', label = 'Adder', price = 500 },
{ model = 'zentorno', label = 'Zentorno', price = 800 }
}
}
Config.TwoWheels = {
vehicles = {
{ model = 'bati', label = 'Bati 801', price = 200 },
{ model = 'pcj', label = 'PCJ 600', price = 150 }
}
}
Config.VehiclePosition = vector3(100.0, 200.0, 300.0)
Config.PlateName = 'RENTAL'You can also adjust debug settings, UI strings, and other behaviors as needed.
- Interact with a Ped: Approach the designated NPC or point on the map to open the rental menu.
- Choose a Vehicle: Select your desired vehicle based on category and price.
- Rent a Vehicle: Once the rental fee is deducted, your chosen vehicle spawns instantly at the designated location.
- Near-Zero Impact: The script maintains 0.00 ms resource usage during normal operation.
- Minimal Spike: A negligible spike of around 0.01 ms occurs during the first vehicle spawn after a restart, as the engine loads necessary assets. After that, performance remains consistently optimal.
- Efficient Idle State: No background processes run when the menu is inactive, ensuring smooth performance even on high-population servers.
Contributions are welcome! To contribute:
- Fork the repository.
- Make your changes (features, bug fixes, optimizations).
- Submit a Pull Request with a clear explanation of your updates.
This project is licensed under the MIT License. See the LICENSE file for details.
If you have any questions or issues, reach out to YOMAN1792 on our Discord server. I'm happy to help!
- Debugging: If you're encountering issues, enable
Config.Debug = trueinconfig.luafor additional debug output. - Plug-and-Play: Designed to integrate seamlessly without modifying ESX core files.