Skip to content

ABUGIZA/F4-Rental

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš— F4-Rental - Professional Car Rental System

A modern, fully-featured car rental system for FiveM servers with a beautiful UI, contract system, and automatic expiry management.

Main Interface

โœจ Features

  • ๐ŸŽจ Modern Dark UI - Beautiful, responsive interface with smooth animations
  • ๐Ÿ“‹ Digital Contracts - Usable rental contract items with all rental details
  • โฐ Automatic Expiry System - Warnings before expiry and late fee management
  • ๐Ÿš™ My Rentals Tab - Track all your active rentals in one place
  • ๐Ÿ’ฐ Flexible Pricing - Hourly-based pricing with customizable durations
  • ๐Ÿ”‘ Vehicle Keys Integration - Automatic key assignment (qb-vehiclekeys/qbx_vehiclekeys)
  • ๐Ÿ’พ Vehicle Persistence - Rented vehicles persist across reconnects
  • ๐Ÿ—บ๏ธ Return Location GPS - Automatic waypoint to return location on expiry

๐Ÿ“ธ Screenshots

Click to view screenshots

Main Rental Interface

Main Interface

My Rentals

My Rentals

Rental Contract

Contract

Expiry Warning

Warning

Return Location GPS

GPS

๐Ÿ“ฆ Dependencies

Optional

  • ox_target / qb-target / interact
  • ox_inventory / qb-inventory
  • qb-vehiclekeys / qbx_vehiclekeys

๐Ÿ› ๏ธ Installation

  1. Download the resource and place it in your resources folder

  2. Import the SQL - Run the SQL file in your database:

    -- Located in: sql/rental_history.sql
  3. Add to server.cfg:

    ensure ox_lib
    ensure oxmysql
    ensure F4-Rental
  4. Configure - Edit config.lua to customize:

    • Rental locations
    • Available vehicles
    • Rental durations
    • Pricing
    • And more...

โš™๏ธ Configuration

Rental Locations

Config.Locations = {
    {
        name = "Premium Rentals",
        coords = vector3(-50.0, -1090.0, 26.5),
        spawnPoint = vector4(-47.0, -1095.0, 26.5, 160.0),
        blip = { sprite = 56, color = 5, scale = 0.8 },
    },
}

Rental Durations

Config.RentalDurations = {
    { label = "1 Hour", hours = 1, multiplier = 1.5 },
    { label = "3 Hours", hours = 3, multiplier = 1.3 },
    { label = "6 Hours", hours = 6, multiplier = 1.2 },
    { label = "12 Hours", hours = 12, multiplier = 1.1 },
    { label = "24 Hours", hours = 24, multiplier = 1.0 },
}

Vehicles

Config.Vehicles = {
    {
        model = "sultan",
        label = "Sultan",
        manufacturer = "Karin",
        category = "Sports",
        price = 500,
        image = "https://docs.fivem.net/vehicles/sultan.webp",
        stats = { speed = 75, acceleration = 70, braking = 65, handling = 72 },
    },
}

๐Ÿ”ง Framework Support

Framework Status
QBox (qbx_core) โœ… Full Support
QBCore โœ… Full Support
ESX Legacy โœ… Full Support

๐Ÿ“ License

This resource is free to use and redistribute. Resale is not permitted.

๐Ÿ’ฌ Support

For support, please open an issue on GitHub or contact the author

๐Ÿ”ง Fixed Issues

Issue Status
Vehicle duplication after server restart โœ… Fixed
Multiple rentals bypass after disconnect โœ… Fixed
Retrieve spawning duplicate vehicles โœ… Fixed
Return not updating database โœ… Fixed

๐Ÿ†• Latest Updates (v1.1.0)

๐ŸŽฅ Update Showcase

Watch Update

โœ… Major Fixes & Improvements

Customer Reported Issues - RESOLVED

  1. DoesEntityExist Script Error (interact/sleepless_interact)

    • โœ… Fixed entity parameter validation in return vehicle event
    • โœ… Added comprehensive type checking and conversion
    • โœ… No more script errors when using target systems
  2. Rental Data Not Deleting After Return

    • โœ… Changed database operation from UPDATE to DELETE
    • โœ… Rentals now properly removed from database on return
    • โœ… Clean database without leftover rental records
  3. QBCore Callback Data Handling

    • โœ… Fixed callback bridge for QBCore framework
    • โœ… Proper data passing between client and server
    • โœ… DELETE operations now work correctly in QBCore

Late Fee System Enhancements

  • ๐Ÿ’ฐ Negative Balance Support - Late fees apply even with insufficient funds
  • ๐Ÿ”„ Continuous Charging - Fees continue until vehicle is returned
  • ๐ŸŽฏ Smart Detection - Only charges online players
  • ๐Ÿ—‘๏ธ Auto-Cleanup - Offline expired rentals are deleted without fees

Database Management

  • ๐Ÿ—„๏ธ Clean Records - All returns now DELETE instead of UPDATE status
  • ๐Ÿš€ Better Performance - Fewer database records to query
  • ๐Ÿ“Š Accurate Tracking - Only active rentals in database

Code Quality Improvements

  • ๐Ÿ› Enhanced Debugging - Comprehensive debug logging for troubleshooting
  • โœ… Better Validation - Improved entity and data validation
  • ๐Ÿ”’ Safer Operations - Proper error handling and fallbacks

๐Ÿ“‹ Technical Changes

// Before (Old Code)
UPDATE rental_history SET status = 'returned' WHERE id = ?

// After (New Code)
DELETE FROM rental_history WHERE id = ? AND citizenid = ?

๐ŸŽฎ Player Experience

  • โœ… Smoother return process without errors
  • โœ… Clear balance warnings when going negative
  • โœ… Fair system: only online players pay late fees
  • โœ… Offline players don't accumulate charges

Demo Videos

Original Demo Latest Update

About

Modern car rental system for FiveM with beautiful UI and contract system

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published