# Callback System

The Callback System (or CBS, for short) is an internal C++ -> Lua callback/communication system.
Can allow you to modify/read values that you normally aren't able to.
You can find a list of every callback on the next page.


# function Add(strCallback, strIdentifier, fnCallback)

Registers a callback that can later be fired from C++.
Example:

hood.Add("HLCreateMove", "MyAwesomeCreateMoveCallback", function(cmd)
    print("My current Usercommand is " .. tostring(cmd) .. "!")
    return false -- You can also modify returns. For example, this prevents the game engine from processing default movement (e.g, modifying viewangles)
end)

Output:
My current Usercommand is CUserCmd [2000]!


# function Remove(strCallback, strIdentifier)

Removes a callback from the callback registry.


# table GetCallbacks()

Gets every callback created, as a table. Structure:

{
    ["Example callback"] = {
        ["Example identifier"] = function: 0xdeadbeef
    }
}