⚠️Troubleshooting

This guide helps resolve common issues with the DevHub Racing script based on configuration and setup.

Resource Not Starting

Check Dependencies

Problem: Resource fails to start or shows errors in console.

Solution:

  1. Ensure devhub_lib is started before this resource:

    -- server.cfg
    ensure devhub_lib
    ensure devhub_laptop
    ensure devhub_racing
  2. If skill tree is enabled, ensure devhub_skillTree is started before:

    -- server.cfg
    ensure devhub_lib
    ensure devhub_skillTree
    ensure devhub_laptop
    ensure devhub_racing
  3. Check for SQL errors - ensure database tables are created:

    • Import sql.sql file into your database

    • Verify tables exist: devhub_racing_maps, devhub_racing_users, devhub_racing_races, etc.

Verify Config Syntax

Problem: Script stops loading or throws Lua errors.

Solution:

  1. Check all config files for syntax errors:

    • Missing commas in tables

    • Mismatched brackets {}, []

    • Unclosed strings ""

    • Invalid Lua syntax

  2. Use a Lua syntax validator or IDE with Lua support to check files.

Check File Permissions

Problem: Resource cannot read configuration files.

Solution:

  1. Ensure all files in configs/ folder have read permissions.

  2. On Linux servers, check file ownership:


Players Cannot Use the System

Check Entry Fee Requirements

Problem: Players cannot join races despite having money.

Solution:

  1. Verify payment method configuration in configs/sh.config.lua:

  2. Ensure players have money in correct account:

    • 'cash' = money on hand

    • 'bank' = bank account balance

  3. Ensure you have correctly configured devhub_lib (NEEDED FOR EACH SCRIPT!)

Verify Vehicle Class Skills

Problem: Players get "must unlock class skill" error.

Solution:

  1. Check if skill tree is enabled in configs/sh.config.lua:

  2. If skill tree enabled, ensure players have unlocked required class:

    • Class C: Starting class (should be auto-unlocked)

    • Classes B, A, S: Must be unlocked via skill tree

  3. Grant skill points to players for testing:

    • Use skill tree admin commands

    • Or temporarily disable: Config.SkillTreeEnabled = false

Check Vehicle Class Restrictions

Problem: "Your vehicle is not allowed in this race" error.

Solution:

  1. Verify vehicle is in correct class in configs/c.vehicleClasses.lua:

  2. Check if race has "ALL" class selected (allows any vehicle).

  3. Debug vehicle hash:

    • Enable debug mode: Config.Debug = true

    • Check console for vehicle model hash when attempting to join

    • Add hash to appropriate vehicle class

Verify Coordinates and Positions

Problem: Players spawn in wrong locations or checkpoints don't work.

Solution:

  1. Ensure map has valid coordinates:

    • Start position set

    • Finish position set

    • At least one checkpoint configured

  2. Check map in database for corrupted data:

  3. Recreate map if coordinates are invalid:

    • Delete problematic map

    • Create new map with map creator

    • Test thoroughly before making official

Check Admin Permissions

Problem: Players cannot create maps/races despite being admin.

Solution:

  1. Verify admin permissions in configs/sh.config.lua:

  2. Ensure devhub_lib (NEEDED FOR EACH SCRIPT!) recognizes player as admin:

    • Check admin system in your framework

    • Test with: Core.IsPlayerAdmin(source) function

    • Verify ace permissions


Features Not Triggering

Verify Callback Functions

Problem: Custom integrations don't execute.

Solution:

  1. Check callback functions in configs/c.functions.lua and configs/s.functions.lua:

  2. Ensure functions don't have errors:

    • Check F8 console for client errors

    • Check server console for server errors

    • Add debug prints to verify execution

  3. Common mistakes:

Check Event Probability Tables

Problem: Rewards or MMR not being awarded.

Solution:

  1. Verify reward tables in configs/sh.config.lua:

  2. Check if MMR is enabled for race type:

  3. Verify XP table (if skill tree enabled):

Ensure Config Values Are Valid

Problem: Features behave unexpectedly or don't work.

Solution:

  1. Check for empty or invalid config values:

  2. Verify data types:

    • Numbers: 1000, 50.5, -25

    • Strings: "cash", "ALL"

    • Booleans: true, false

    • Tables: {}, { key = value }

  3. Check for typos in config keys:


Props, UI and Events Not Working

Verify Prop Models Exist

Problem: Props don't appear in map creator or during races.

Solution:

  1. Check prop model names in configs/c.creatorProps.lua:

  2. Test prop models in-game:

    • Create spawn prop command example:/spawnprop prop_beachflag_01

    • Verify model exists in game files

  3. Common issues:

    • Typo in prop name

    • DLC prop requiring specific game build

    • Custom prop not installed on server

    • Model streaming issues (add to fxmanifest.lua if needed)

Enable Debug Mode

Problem: Unable to identify what's failing.

Solution:

  1. Enable debug mode in configs/sh.config.lua:

  2. Check logs in:

    • F8 console (client-side)

    • Server console (server-side)

    • Browser console (NUI errors)

  3. Look for specific error messages:

    • Script errors (Lua syntax)

    • Network errors (API calls failing)

    • Asset loading errors (props, images, sounds)

Verify Asset References

Problem: Images, sounds, or UI elements don't load.

Solution:

  1. Check image URLs in configs:

  2. Verify sound files exist:

    • Check public/sounds/ folder

    • Files: countdown.wav, fireworks.mp3, swoosh.wav

    • Ensure proper file formats (WAV, MP3, OGG)

  3. Check NUI resource path:

  4. Test asset loading:

    • Open browser console (NUI devtools)

    • Check for 404 errors or loading failures

Restart in Correct Order

Problem: Script partially works or has intermittent issues.

Solution:

  1. Proper startup order:

  2. Server restart sequence:

  3. Individual resource restart:

  4. Full server restart recommended after:

    • Database changes

    • Major configuration changes

    • Adding/removing dependencies


Race Mechanics Issues

Checkpoint Not Detecting

Problem: Players drive through checkpoints but they don't register.

Solution:

  1. Check checkpoint marker settings and devMode:

  2. Verify checkpoint placement in map:

    • Checkpoints too far apart

    • Checkpoint trigger zone too small

    • Checkpoints placed incorrectly (underground, in air)

  3. Test with debug mode enabled:

    • See checkpoint coordinates

    • Verify player position vs checkpoint position

    • Check trigger distance calculations

  4. Recreate problematic checkpoints:

    • Edit map in map creator

    • Delete and re-place checkpoint

Race Will Not Start

Problem: Countdown doesn't begin or race is stuck.

Solution:

  1. Check minimum player requirement:

    • At least 1 player required

    • Verify players are in waiting room state

  2. Verify start time configuration:

  3. Check server time vs configured time:

    • Server might be in different timezone

    • Use /time command to check current server time

    • Adjust scheduled times accordingly

  4. Manual race start issues:

    • Check if start delay expired

    • Verify race is not already in progress

    • Ensure no conflicting race instances

Blips Not Showing

Problem: Map markers and checkpoint blips invisible.

Solution:

  1. Check blip configuration in configs/sh.config.lua:

  2. Verify player distance to race start:

    • Must be within showDistance range

    • Increase range for testing:

  3. Check for blip sprite conflicts:

    • Try different blip sprite IDs

    • Use unique blip sprites not used elsewhere

Collisions Not Working as Expected

Problem: Player collisions disabled when they should be enabled (or vice versa).

Solution:

  1. Check race configuration:

  2. Note: Props are always collision-free by design:

    • Prevents players getting stuck on decorations

    • Allows passing through checkpoint markers

    • Cannot be changed via config

  3. Verify entity collision settings:

    • Check if other scripts override collision

    • Test in isolated environment (no other scripts)


UI and Display Issues

Racing App Not Opening

Problem: Laptop app doesn't display racing interface.

Solution:

  1. Check laptop integration:

  2. Test NUI directly:

    • F8 console: loadnui https://cfx-nui-devhub_racing/html/index.html

    • Check NUI console for errors

  3. Ensure laptop resource is compatible:

    • Verify devhub_laptop is installed (if required)

    • Check laptop app registration

Translations Not Displaying

Problem: UI shows translation keys instead of text.

Solution:

  1. Check language file completeness in configs/sh.lang.lua:

  2. Verify translation key matches code:

    • Check for typos in translation keys

    • Ensure key exists in config

    • Use exact key name (case-sensitive)

  3. Missing translations:

    • Copy missing keys from default sh.lang.lua

    • Translate to your language

    • Restart resource

Music Not Playing

Problem: Race music doesn't play or is silent.

Solution:

  1. Check music configuration in configs/sh.config.lua:

  2. YouTube embed restrictions:

    • Some videos are blocked by copyright

    • Use royalty-free music or licensed tracks

    • System auto-skips blocked videos to next track

  3. Player settings:

    • Press G in-game to toggle music

    • Check game audio settings (not muted)

    • Test with different browsers (NUI)


Discord Integration Issues

Webhooks Not Sending

Problem: Discord messages not appearing.

Solution:

  1. Verify webhook URLs in configs/s.logs.lua:

  2. Test webhook URLs:

    • Paste in browser (should show "Invalid webhook token" - this is correct)

    • Copy from Discord server settings > Integrations > Webhooks

    • Ensure webhook is not deleted in Discord

  3. Check Discord channel permissions:

    • Webhook must have permission to send messages

    • Channel must exist and be accessible

    • Webhook not rate-limited

Announcement Formatting Issues

Problem: Discord messages display incorrectly.

Solution:

  1. Check translation strings for webhook in configs/sh.lang.lua:

  2. Verify embed structure in code:

    • Discord embeds have field limits (256 chars for field names, 1024 for values)

    • Check for special characters breaking JSON

    • Validate embed colors (must be valid hex or decimal)


Database Issues

Data Not Saving

Problem: Player stats, maps, or races not persisting.

Solution:

  1. Verify SQL tables exist:

  2. Import SQL file if missing:

    • Locate sql.sql in resource folder

    • Restart server after import

  3. Check database permissions:

  4. Look for SQL errors in console:

    • Check server console for MySQL errors

    • Common: Duplicate keys, constraint violations

    • Fix data inconsistencies in database

Leaderboard Not Updating

Problem: Leaderboard shows old data or doesn't refresh.

Solution:

  1. Check cache timeout:

  2. Force cache refresh:

    • Wait for cache timeout to expire

    • Restart resource: restart devhub_racing

  3. Verify leaderboard query:

    • Check for database errors in console

    • Test query directly in database

    • Ensure proper indexing on database tables


General Troubleshooting Checklist

Before reporting issues, verify:

If issues persist:

  1. Enable debug mode for detailed logs

  2. Check client (F8) , server and NUI console

  3. Test with minimal configuration (disable features one by one)

  4. Verify issue on clean server with only required resources

  5. Check for updates to devhub_racing , devhub_lib, devhub_laptop

  6. Contact DevHub support with:

    • Server console logs

    • Client console logs (F8)

    • NUI console logs (F8 NUI devtools)

    • Config files (with sensitive data removed [webhooks])

    • Steps to reproduce the issue

Last updated