This is a FiveM script that allows players to rent vehicles at specific locations in the game. The script includes a user-friendly menu for selecting vehicles, a timer-based rental system, and integration with the ESX framework. Players can rent vehicles for a set duration, with costs deducted from their in-game bank balance. The script also includes checks to ensure that there are not enough on-duty taxi drivers before allowing rentals.
- Vehicle Rental System: Players can rent vehicles from predefined locations marked with blips and markers.
- Configurable Options: Customize vehicles, prices, rental duration, and marker locations in
config.lua. - ESX Integration: Uses ESX framework for player management and bank transactions.
- Random License Plates: Generates unique license plates for rented vehicles.
- Timer System: Automatically removes rented vehicles after the rental period expires or if the player leaves the vehicle for too long.
- Blip and Marker Support: Visual indicators for rental locations.
- Notification System: In-game notifications for various actions (e.g., successful rental, insufficient funds).
- Ensure you have the ESX framework and NativeUI installed in your FiveM server.
- Copy the script folder to your server's
resourcesdirectory. - Add
ensure rentcarto yourserver.cfg. - Configure the
config.luafile to adjust vehicle options, rental prices, and marker locations as needed. - Restart your server or use the
refreshandstart rentcarcommands.
- ESX Framework: Required for player management and bank transactions.
- NativeUI: Required for the menu interface.
fxmanifest.lua: Resource manifest file.config.lua: Configuration file for vehicles, prices, and rental locations.client.lua: Client-side script handling the rental menu, vehicle spawning, and timers.server.lua: Server-side script for ESX integration and money deduction logic.
- Approach a rental location (marked by a blip and marker).
- Press the interaction key (default:
E) to open the rental menu. - Select a vehicle and confirm the rental (cost will be deducted from the player's bank).
- Drive the vehicle for the rental duration. A per-minute fee will be deducted if configured.
- If the player exits the vehicle for more than 60 seconds, it will be deleted.
- The vehicle will also be deleted when the rental duration expires.
/kirtotaxi: Opens the rental menu if the player is eligible to rent (based on taxi driver availability).
Edit config.lua to:
- Set the required number of online taxi drivers (
Config.RequiredTaxiOnline). - Adjust the rental duration (
Config.RentDuration) in minutes. - Set the per-minute rental fee (
Config.PricePerMinute). - Define available vehicles and their prices (
Config.RentVehicles). - Specify rental locations (
Config.RentMarkers).
- Ensure that the vehicle models listed in
config.luaare available in your server. - The script checks for online taxi drivers to prevent rentals if enough taxis are available.
- Players must have sufficient funds in their bank to rent a vehicle or continue the rental.
- Author: Arad | github.com/aradashkan
- Version: 1.0.0
این اسکریپت برای FiveM طراحی شده است و به بازیکنان امکان میدهد تا در مکانهای مشخصی در بازی خودرو اجاره کنند. این اسکریپت شامل یک منوی کاربرپسند برای انتخاب خودروها، سیستم اجاره مبتنی بر زمان، و ادغام با فریمورک ESX است. بازیکنان میتوانند خودروها را برای مدت زمان مشخصی اجاره کنند و هزینهها از موجودی بانکی آنها در بازی کسر میشود. همچنین، اسکریپت بررسی میکند که تعداد رانندگان تاکسی آنلاین کافی نباشد تا اجاره امکانپذیر شود.
- سیستم اجاره خودرو: بازیکنان میتوانند از مکانهای مشخصشده با نشانگرها و بلیپها خودرو اجاره کنند.
- گزینههای قابل تنظیم: امکان سفارشیسازی خودروها، قیمتها، مدت زمان اجاره، و مکانهای نشانگر در فایل
config.lua. - ادغام با ESX: استفاده از فریمورک ESX برای مدیریت بازیکنان و تراکنشهای بانکی.
- پلاک تصادفی: تولید پلاکهای منحصربهفرد برای خودروهای اجارهای.
- سیستم تایمر: حذف خودکار خودروهای اجارهای پس از اتمام دوره اجاره یا در صورت خروج طولانیمدت بازیکن از خودرو.
- پشتیبانی از بلیپ و نشانگر: نشانههای بصری برای مکانهای اجاره.
- سیستم اعلان: اعلانهای داخل بازی برای اقدامات مختلف (مانند اجاره موفق، کمبود موجودی).
- اطمینان حاصل کنید که فریمورک ESX و NativeUI روی سرور FiveM شما نصب شدهاند.
- پوشه اسکریپت را در پوشه
resourcesسرور کپی کنید. - در فایل
server.cfgخطensure rentcarرا اضافه کنید. - فایل
config.luaرا برای تنظیم گزینههای خودرو، قیمتها، و مکانهای اجاره ویرایش کنید. - سرور را ریاستارت کنید یا از دستورات
refreshوstart rentcarاستفاده کنید.
- فریمورک ESX: برای مدیریت بازیکنان و تراکنشهای بانکی ضروری است.
- NativeUI: برای رابط کاربری منو مورد نیاز است.
fxmanifest.lua: فایل مانیفست منبع.config.lua: فایل تنظیمات برای خودروها، قیمتها، و مکانهای اجاره.client.lua: اسکریپت سمت کلاینت برای مدیریت منوی اجاره، تولید خودرو، و تایمرها.server.lua: اسکریپت سمت سرور برای ادغام با ESX و منطق کسر پول.
- به یک مکان اجاره (مشخصشده با بلیپ و نشانگر) نزدیک شوید.
- کلید تعامل (پیشفرض:
E) را فشار دهید تا منوی اجاره باز شود. - یک خودرو انتخاب کنید و اجاره را تأیید کنید (هزینه از حساب بانکی بازیکن کسر میشود).
- خودرو را در طول مدت اجاره رانندگی کنید. در صورت تنظیم، هزینهای بهصورت دقیقهای کسر میشود.
- اگر بازیکن بیش از 60 ثانیه از خودرو خارج شود، خودرو حذف خواهد شد.
- خودرو همچنین پس از اتمام مدت زمان اجاره حذف میشود.
/kirtotaxi: اگر بازیکن واجد شرایط اجاره باشد (بر اساس تعداد رانندگان تاکسی آنلاین)، منوی اجاره را باز میکند.
فایل config.lua را ویرایش کنید تا:
- تعداد رانندگان تاکسی آنلاین مورد نیاز (
Config.RequiredTaxiOnline) را تنظیم کنید. - مدت زمان اجاره (
Config.RentDuration) را به دقیقه تنظیم کنید. - هزینه اجاره بهصورت دقیقهای (
Config.PricePerMinute) را تعیین کنید. - خودروهای موجود و قیمتهای آنها (
Config.RentVehicles) را تعریف کنید. - مکانهای اجاره (
Config.RentMarkers) را مشخص کنید.
- اطمینان حاصل کنید که مدلهای خودرو ذکرشده در
config.luaدر سرور شما موجود باشند. - اسکریپت بررسی میکند که تعداد رانندگان تاکسی آنلاین کافی نباشد تا اجاره امکانپذیر شود.
- بازیکنان باید موجودی کافی در بانک خود داشته باشند تا بتوانند خودرو اجاره کنند یا اجاره را ادامه دهند.
- نویسنده: آراد | github.com/aradashkan
- نسخه: 1.0.0