Always test changes on a staging server before applying them to your live environment.
1. Initial checks
1
Check console output
Look for errors or warnings after starting the server. Search for tags like
[my_script_name]
.2
Verify dependencies
Ensure required frameworks and libraries are started before your script in
server.cfg
.3
Confirm folder name
The folder name must match the
ensure
command exactly.2. Using debug mode
Enable debug mode inconfig.lua
to get more detailed console output:
Remember to disable debug mode in production for better performance.
3. Checking database connections
Test a query
Check connection logs
Monitor your database server logs for errors or slow queries.
4. Common error sources
Script not starting
Script not starting
- Missing or outdated dependencies
- Incorrect folder name
- Syntax errors in modified files
Features not working
Features not working
- Permissions not set correctly in
config.lua
- Missing framework event hooks
Performance drops
Performance drops
- Debug mode left enabled
- Unoptimized loops or frequent database queries
5. Client-side vs Server-side issues
- Client-side: Usually cause UI problems, missing prompts, or incorrect visuals.
- Server-side: Affect data handling, events, and player state.
Use
print()
in Lua or Citizen.Trace()
to output debug information to the console.6. Using the framework bridge
If you are on a custom framework, review theframeworkBridge.lua
file and ensure all required functions are implemented for your environment.
7. Testing changes
- Make one change at a time.
- Restart the resource with:
- Verify the fix before moving to the next change.