Advanced ESX Mechanic Job
Prompt
Create a comprehensive and advanced mechanic job script for FiveM ESX framework that includes the following features: 1. **Vehicle Repair and Part Replacement:** Mechanics must be able to repair specific vehicle parts (engine, battery, tires, brakes, etc.) and replace them physically. Include detailed handling such as removing and swapping wheels with different types. 2. **Breakdown Risk System:** Implement a mileage-based breakdown risk system. When a vehicle reaches approximately 100,000 km, add random chances for breakdowns like battery failure, engine trouble, or tire blowouts. Use timers or mileage tracking to simulate wear and tear realistically. 3. **Tire Management:** Allow the mechanic to remove tires physically from the vehicle using proper animations, and install different types of tires or wheels. Ensure the mechanics affect vehicle performance accordingly. 4. **Realistic Animations:** Integrate fairly realistic mechanic animations throughout the interaction process, such as using tools, removing parts, replacing components, and inspecting vehicles. 5. **Boss Features:** Include boss-level management functionalities such as recruiting new mechanics, firing staff, managing payroll, and accessing business-related menus. 6. **Integration with ox_target, ox_lib, and ox_inventory:** Maximize interaction using the ox_target system for targeted interactions, ox_lib for utility functions, and ox_inventory to handle all inventory-related processes, including parts management, tool usage, and stock control. 7. **High Interaction Depth:** The job should be feature-rich and immersive, enabling dynamic player roles and interactions within the mechanic job, with detailed UI/UX where applicable. # Steps 1. Define vehicle parts and their states (working, damaged, broken). 2. Track vehicle mileage and incorporate a system to trigger random breakdown events based on use. 3. Implement part repair and replacement mechanics, with physical representation (e.g., removing a tire). 4. Develop animations for each mechanic action using appropriate FiveM animation libraries. 5. Create boss menus with recruitment, firing, and financial management using ESX and ox_lib. 6. Integrate ox_target for contextual targeting and interaction prompts. 7. Connect all inventory actions (storing parts, tools) to ox_inventory. 8. Test the system thoroughly for realistic behaviour and game balance. # Output Format Provide the complete, well-documented FiveM ESX Lua job script along with any additional resource files (client, server, animations, config), organized and ready to deploy. Include comments explaining critical parts, how to install and configure, and usage instructions for integrating ox_target, ox_lib, and ox_inventory. If external dependencies or assets are needed, specify them clearly. # Notes - Prioritize performance and modular design to facilitate future extensions. - Ensure compatibility with the latest stable versions of ESX, ox_target, ox_lib, and ox_inventory. - Include fail-safes for edge cases such as repairing already working parts or replacing missing components. - Make animations non-disruptive and sync appropriately for all players nearby. # Response Formats Output should be a structured and commented Lua script with supporting files, ready for direct use or adaptation in a FiveM ESX server environment.
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.