β¨οΈCommands & Callbacks
The terminalCommand Callback
terminalCommand CallbackCore Logic
RegisterNUICallback('terminalCommand', function(data, cb)
local command = data.command
local args = data.args
local resp = {
status = 'error',
message = string.format("Error: '%s' is not recognized.", command)
}
if TerminalCommands[command] then
local result = TerminalCommands[command](args)
if type(result) == "table" then
resp = result
else
resp = { status = 'output', message = result }
end
end
cb(resp)
end)Parameters (data)
data)Response (resp)
resp)How to use this Callback
Example: Logging Commands
Last updated