LogoLogo
  • Codesign Documentation
  • Information
    • Discord Roles
    • FiveM Asset Escrow System
    • Authentication & Transfers
  • Coding Information
    • Register Key Mapping
    • Code Snippets
    • Self Debugging
  • Paid scripts
    • Arm Wrestling
      • Configs, Locales & SQL
    • Car HUD
      • Configs, Locales & SQL
    • CCTV Cameras
      • Configs, Locales & SQL
    • Darts
      • Configs, Locales & SQL
    • Dispatch
      • Configs, Locales & SQL
      • Resource Integration
    • Door Lock
      • Configs, Locales & SQL
    • Garage
      • Keys/Chat/Events/Exports
      • Optional Features
      • Configs, Locales & SQL
      • Resource Integration
    • Gun Range
      • Configs, Locales & SQL
    • Identity
      • Configs, Locales & SQL
    • Multicharacter
      • Configs, Locales & SQL
    • Player HUD
      • Configs, Locales & SQL
    • Props
      • Configs, Locales & SQL
    • Radar
      • Configs, Locales & SQL
    • Spawn Select
      • Configs, Locales & SQL
    • Terminal Hacker
      • Configs, Locales & SQL
    • Vehicle Control
      • Configs, Locales & SQL
    • VIP Shop
      • Configs, Locales & SQL
  • Free Scripts
    • Easytime
      • Keys/Chat/Events/Exports
      • Optional Features
      • Configs & Locales
    • Drawtext UI
    • Devtools
    • Keymaster - Minigame
    • Staff Support
    • Notifications
Powered by GitBook
LogoLogo

Codesign Software © All rights reserved

On this page
  • Troubleshooting
  • LUA Debugging
  • Basic LUA Debugging Example
  • LUA Table Debugging
  • Useful Tip for LUA Debugging
  • FAQ
  • SQL Debugging

Was this helpful?

  1. Coding Information

Self Debugging

A short guide on how you can debug code yourself in order to provide more detailed information to the codesign support team.

PreviousCode SnippetsNextArm Wrestling

Last updated 12 months ago

Was this helpful?

Translate

What is self debugging?

If you have little experience with LUA and coding, please read this and do your own research on how to debug code with prints, its first thing you MUST know when buying resources, as if your expecting scripts to just work every time on every server without having ANY issues, that's your first mistake.

If we can not recreate the issues you report, we have to rely entirely on you to debug your code in order to provide us with the information we need in order to help YOU.

Troubleshooting

1. Check if the script has been authorized correctly. Enable Config.DebugPrints in the config.lua and check the server console to make sure there are no errors saying You lack the required entitlement? and check for 2 client-sided prints saying Loaded Successfully!.

2. Check for obvious error prints in the server console and the client F8 console. If you don't see any obvious errors make sure to restart the script while the server is live and check again.

3. If applicable, change the key in the config.lua to one that you know works, as one of your other resources, may be disabling that specific key. Please read for more information regarding .

4. If none of the above worked, have a second read through the installation guide, you may have missed something - you are only human.

If all else fails, contact the Codesign Team in the ..

LUA Debugging

Basic LUA Debugging Example

Option 1: You can print the variables being received/sent in events/functions (or just any variables in general). But you will not be able to print booleans unless you convert them into strings.

Option 2: You can also use prints to debug what may be causing a script to error or what may be causing the code to not reach a certain line. We can do this by adding a print on every line in a certain part of the code which is having issues (just change the string in the print so it's unique eg., "here 1", "here 2"), and you will be able to see which line the code is not able to get passed, then you will know what line of code is causing the problem.

Option 3: In most cases, these are both best used together to actually see what's going on in the code.

LUA Table Debugging

If you try to print a table using the methods above, it will normally look like this - table: 0xe2a670.

So in order to see the data inside tables we need to use another method, luckily we released a free resource which does just this!

Useful Tip for LUA Debugging

What this does is display all of the prints on your screen instead of only displaying them in the client-side F8 console, it's just a small quality-of-life feature for developers.

Type this in your client-side F8 console:

con_miniconChannels script:*

Type this in your client-side F8 console:

con_miniconChannels 0

FAQ

Do you still need more help with prints?

Here are a couple of links to help you further:

SQL Debugging

This will print all SQL queries into your server console so you can see what's going on database-wise.

Add any of these lines anywhere in your server.cfg.

set mysql_debug "Console"
set mysql_debug

Click here to translate this page.
How do I change language?
#key-mapping
Codesign Discord
Download
Documentation
YouTube Preview
Documentation
YouTube Tutorial
This is a basic example of how to debug LUA code.
This is a preview from cd_devtools.
This is an example of this in use.
This is an example of SQL debug prints in the server console.