Back to Coding

Advanced ESX Company System

Prompt

You are tasked with developing a sophisticated, high-quality ESX framework script named "mv-scripts" that manages an advanced company management system within a FiveM server environment. The script must integrate server-side logic and SQL database interaction, provide real-time client-server interactions using callbacks, and be optimized to ensure resource usage remains under 0.01ms on resmon. The script must adhere to these technical requirements: - Use the ox_lib library, but not ox_core, along with ox_inventory, ox_lib notify, ox_lib context menu, ox_lib alert dialog, and ox_target. - Remove any UI (NUI) components and replace user interfaces exclusively with ox_context menu and other ox_lib components to keep the script modern, lightweight, and server-friendly. - Include robust logging features with detailed audit logs, Discord webhook integration using rich embed messages for significant events. - Implement strict permission controls and configurable settings accessible within the script. - Support multilanguage localization for all user-facing text. Functionality and features to implement: 1. Company Creation: - Players can establish companies with attributes: name, industry, description. 2. Employee Management: - Ability to hire, fire, and manage employees including setting and distributing salaries. 3. Financial Management: - Company accounts to handle deposits, withdrawals, and transfers. - Implement detailed transaction logs. - Include a billing system for customers and payments. 4. Customer and Sales Management: - Inbuilt customer relationship management (CRM). - Sales invoicing system. 5. Data Display and Reporting: - Use ox_context menus to show tables, forms, and company reports without NUI. 6. Rankings & Leaderboards: - Maintain a small business ranking list based on income. You must provide: - A fully functional and optimized script structured as a FiveM ESX resource in a zipped archive. - High-quality code with comprehensive comments. - Use of modern ESX patterns and idioms without UI overlays. - Appropriate server-client communication via callbacks. Step-by-step guidance: - Initialize a new ESX resource named mv-scripts. - Configure SQL database schema for company, employee, financial, customer, and audit log data. - Implement server-side logic for all business operations, including permission checks. - Develop client-side ox_context based menus for company and employee management, financial operations, and reporting. - Integrate Discord webhook logging with rich embeds for major events such as company creation, hiring/firing, large transactions. - Optimize all code and database queries to keep resmon under 0.01ms. - Include multilanguage support via localization files. Please generate the complete script ready for deployment and zipped for immediate use. # Output Format Provide the entire source code for the ESX resource "mv-scripts" as a ready-to-use project structure in a zip file format. Include: - server and client scripts - SQL schema files - localization files - resource manifest - configuration files Ensure all files reflect best practices for ESX scripting and make extensive use of ox_lib components as specified. # Notes - Prioritize performance and maintainability. - Avoid any deprecated ESX design patterns. - Do not include NUI or web-based UI elements. - The script should be compatible with a current stable version of ESX and FiveM. - Make sure to document any assumptions or configuration steps in a README file inside the zip. # Examples - For context menu usage: Use ox_lib context menu for all interactive menus instead of NUI tables or forms. - For notifications: Use ox_lib notify system. - Use ox_target for entity and object targeting in the game world. Create this advanced and complete ESX company management script as mv-scripts with all specified criteria and features, ready to deploy on a server with minimal configuration.

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.