Advanced FiveM Fishing System
Prompt
Create a comprehensive, advanced Fishing System for FiveM that offers a realistic, cinematic, and fully interactive fishing experience with persistent data stored in a full SQL database. The fishing system must include the following components and features: 1. **Fishing Core System:** - Implement an interactive fishing mechanic featuring skill checks, reaction-time events, tension bars, and quick-time event (QTE) mini-games. - Provide realistic fishing rod casting with synchronized animations, sound effects, water splash effects, and physically believable fishing line dynamics. - Include multiple fish species categorized by rarity tiers, with associated attributes such as weight, size, and value. - Dynamic fish spawning that responds to variables like time of day, weather conditions, fishing zone, and bait type selected. - Model rod damage incorporating durability reduction and break chances influenced by line tension. 2. **Fishing Zones:** - Configure diverse fishing zones (e.g., river, lake, ocean, deep-sea) each with custom loot tables. - Support boat fishing and exclusive deep-water species. - Include an optional diving mode enabling players to catch rare underwater fish. 3. **Progression & Economy:** - Design an XP and level system unlocking rods, baits, and perks. - Integrate shops where players can buy rods, upgrades, bait, and accessories. - Create a selling system with dynamic pricing, rarity-based multipliers, and daily special bonuses. - Provide compatibility with ESX and QBCore frameworks and standalone mode. 4. **NUI (HTML/CSS/JS):** - Build a modern, animated user interface encompassing: • Fishing mini-game display • Fish inventory management • Rod and bait selection interface • Catch results highlighting rarity via color, weight, and price • A fish encyclopedia showing stats, info, and spawn schedules - Utilize smooth futuristic animations and immersive sound effects. 5. **Config File:** - Make system parameters fully configurable including: • Rod tiers • Bait effects and bonuses • Weather multipliers • XP gain rates • Rarity tables • Fishing areas and coordinates • UI themes and colors • Option to enable or disable advanced mode 6. **Server Logic (SQL Required):** - Persist all caught fish data in the database. - Save player fishing stats such as XP, level, unlocked items, and achievements. - Securely validate all catches, rarity rolls, XP gains, and selling transactions. - Define SQL tables: fishing_players, fishing_inventory, fishing_logs, fishing_leaderboard. 7. **Client Logic:** - Manage player interactions with fishing spots including casting, waiting, bite detection, reaction QTEs, and catching animations. - Employ cinematic camera angles especially for legendary and rare catches. - Add water splash visual effects and rod tension indicators. 8. **Extra Features:** - Introduce ultra-rare legendary fish with a 0.01% spawn chance. - Implement fishing tournaments utilizing the SQL leaderboard. - Send notifications to Discord webhook upon rare catches. - An achievement system awarding badges and rewards. - Seasonal fish that appear exclusively in summer or winter. 9. **Output Structure:** Generate complete code and files for the fishing system including: 1) fxmanifest.lua 2) config.lua 3) client/main.lua 4) server/main.lua 5) html/index.html 6) html/style.css 7) html/script.js 8) fishing.sql - Full SQL database schema and seed data 9) README.md - Installation and setup guide with clear instructions Additional Requirements: - Ensure all code is clean, modular, well-documented, and optimized. - Compatibility with ESX, QBCore, and standalone environments. - The gameplay should be cinematic, smooth, immersive, and enjoyable. # Steps - Design the data schema for persistence reflecting players, inventory, logs, and leaderboards. - Develop server-side logic to handle database interactions, validations, and secure transactions. - Implement client-side logic for fishing mechanics including animations, QTEs, camera controls, and visual effects. - Build configurable zones and dynamic spawning relying on weather and time. - Create the NUI front-end with responsive, animated UI and relevant sound effects. - Integrate progression systems, shops, economy, and achievements. - Include webhook integration for Discord notifications. - Provide a detailed README covering installation, configuration, and usage. # Output Format Provide all code files explicitly as listed above with clear comments and modular structure, including the SQL file defining tables and seed data, and a README.md markdown file with installation instructions. # Notes - Preserve security best practices for database communication and user data. - The system must run smoothly in FiveM environments and adapt to ESX or QBCore if detected. - All UI elements should be modern and visually appealing with smooth animations.
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.