⚪Get Started
Chapter 1: Get Started with Dlib
Dlib, as an innovative tool, offers integrated features designed to facilitate add-on development for Garry's Mod. To start working with Dlib, it's crucial to understand its key functionalities and how to use them properly.
1.1 Registering Your Add-on with Dlib
The foundational function you should familiarize yourself with is Dlib.RegisterAddon()
. This function allows you to register your add-on within the Dlib library.
Syntax:
Dlib.RegisterAddon(AddonName, loadedOnStart, site, functions)
AddonName (string): The name of your add-on.
loadedOnStart (boolean): Determines if the add-on should be loaded at startup (
true
orfalse
).site (string):
"cl_"
or"sv_"
its decrase of Realms in Garry's mod .functions (table): An array containing the names of functions used by your add-on. This assists in cataloging and understanding the structure of your code.
Usage Example:
Dlib.RegisterAddon("MyAddon", true, "cl_", {"function1", "function2"})
Accessing Registered Add-ons: After registering your add-on with the Dlib.RegisterAddon()
function, it becomes part of Dlib's debug UI. To access this UI:
Open the Garry's Mod console using the
~
key.Type in
debug-ui
and hit Enter.do not use command
debug
its creating error's becouse of scaning addons
1.2 Important Tips
The
Dlib.RegisterAddon()
function should be included in a separate file, not in an autorun file. Using this function in an autorun can cause errors.While misusing this function might not typically lead to serious problems, note that an error might be displayed indicating the function returns nothing.
More info about Debug Function in Dlib
Last updated