Advanced ESX Car Dealership
Prompt
Create a comprehensive, advanced, and fully functional car dealership script for ESX Legacy, incorporating all the detailed features and requirements specified below. The system must include these key components: === KEY FEATURES === š¢ Owned Car Dealership System: - Allow players to buy, name, and own their own car dealership. - Enable dealership owners to manage employees, set vehicle prices, and configure dealership settings. š§āš¼ Custom Job Ranks: - Support customizable dealer-specific job ranks (e.g., Owner, Manager, Salesperson, Trainee). - Ensure ranks control access to UI features appropriately. š Custom Blip, Job Name & Vehicle Prices: - Allow each dealership to have a unique map blip. - Support custom job names for each dealership. - Enable unique vehicle pricing per dealership. š Vehicle Catalog with Images: - Admins must be able to add vehicles to a catalog. - Each vehicle entry must include an image, price, and description. šØ Full Color System: - Incorporate all GTA vehicle colors. - Provide live color previews in the vehicle selector UI. š Test Drives & Display Vehicles: - Enable players to test drive vehicles. - Allow dealers to spawn display vehicles. š Sales & Performance Stats: - Track employee sales and overall company performance statistics. š§š Best Employee Highlight: - Automatically select and display the top-selling employee. - Include a mugshot image using MugShotBase64. š¦ Order & Inventory Management: - Manage vehicle catalog, purchasing, deliveries, stock, and order history. š„ļø Custom UI (Computer + Tablet): - Build modern, clean, and fully NUI-based (HTML/CSS/JS) UIs for: - Vehicle Catalog - Inventory - Order History - Open Orders - Price Lists - Dealership Configuration - Employee Management === CONFIG FILES === config.lua: - Manage all server/client settings, translations, and texts in Lua. config.js: - Handle UI texts, layout settings, colors, and labels. === LANGUAGES === - Include English and German languages. - Ensure easy addition of more languages. === CUSTOMIZABLE ELEMENTS === - Vehicles, colors, prices, dealership names, and ranks must be easily configurable. === TECHNICAL NOTES === - The script must be compatible with ESX Legacy. - Include and require MugShotBase64 (included). - Optionally support a custom vehicle image folder. - Code clarity is essential; comment extensively. - UI must avoid NativeUI; use only modern NUI (HTML/CSS/JS). - Use ESX callbacks, events, and ox_lib where appropriate. - Partial code obfuscation is allowed but maintain open config files. === DEVELOPMENT PROCESS === - Begin by outlining the entire file structure. - Deliver the code in organized, step-by-step portions. - Provide all files: client.lua, server.lua, manifest file, config.lua, config.js, and UI files. - Present all code in well-structured, clear code blocks. # Steps 1. Define the full file and folder structure for the project. 2. Create config files (config.lua and config.js) with all necessary settings and translations for both English and German. 3. Implement the server-side logic in server.lua covering dealership ownership, employee management, vehicle catalog, sales tracking, and order processing. 4. Implement client-side logic in client.lua for UI interaction, test drives, vehicle spawning, color selection, and blip management. 5. Build the NUI interfaces (HTML/CSS/JS) for all required UIs, ensuring a modern and clean look. 6. Integrate MugShotBase64 functionality to provide mugshot images where needed. 7. Implement necessary manifest and metadata files compatible with ESX Legacy. 8. Ensure all code is thoroughly commented. 9. Use ESX callbacks, events, and ox_lib usage properly in client-server communication. # Output Format - All code must be delivered in well-formatted markdown code blocks specifying the language. - Include file path comments to indicate each file's location. - Separate sections logically and present them clearly for easy review and implementation. # Notes - Project should allow easy expansion and modification. - Prioritize clear communication between client and server. - Keep UI responsive and user-friendly. Build this system step-by-step, starting with the full directory and file structure.
Related Coding Prompts
Write Code
As a seasoned programmer, your task is to write code in [programming language] to [perform action]. The code should be efficient, well-structured, and optimized for performance. Make sure to follow best practices and industry standards while implementing the necessary algorithms and logic to achieve the desired functionality. Test the code thoroughly to ensure it functions as intended and meets all requirements. Additionally, document the code properly for future reference and maintenance.
Debug Code
Act as a seasoned programmer with over 20 years of commercial experience. Analyze the provided [piece of code] that is causing a specific [error]. Your task involves diagnosing the root cause of the error, understanding the context and functionality intended by the code, and proposing a solution to fix the issue. Your analysis should include a step-by-step walkthrough of the code, identification of any bugs or logical mistakes, and a detailed explanation of how to resolve them. Additionally, suggest any improvements or optimizations to enhance the performance, readability, or maintainability of the code based on your extensive experience. Ensure that your solution adheres to best practices in software development and is compatible with the current development environment where the code is being executed.
Do Code Review
As a seasoned programmer with over 20 years of commercial experience, your task is to perform a comprehensive code review on the provided [piece of code]. Your review should meticulously evaluate the code's efficiency, readability, and maintainability. You are expected to identify any potential bugs, security vulnerabilities, or performance issues and suggest specific improvements or optimizations. Additionally, assess the code's adherence to industry standards and best practices. Your feedback should be constructive and detailed, offering clear explanations and recommendations for changes. Where applicable, provide examples or references to support your suggestions. Your goal is to ensure that the code not only functions as intended but also meets high standards of quality and can be easily managed and scaled in the future. This review is an opportunity to mentor and guide less experienced developers, so your insights should be both educational and actionable.