ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. outputDebugString

Function

outputDebugString

Server and clientChat and consoleIdentical to MTA:SA

Adds an entry to the debug log (/debugscript). Levels 1-3 add the script file and line.

Syntax

bool outputDebugString(string message [, int level = 3, int r = 255, int g = 255, int b = 255])

Arguments

messagestring
The text.
levelint, optional = 3
0 custom colour, 1 error, 2 warning, 3 information, 4 plain text.
rint, optional = 255
Red for level 0.
gint, optional = 255
Green for level 0.
bint, optional = 255
Blue for level 0.

Returns

true on success.

Example

local function loadConfig()
    local file = fileOpen("config.json", true)
    if not file then
        outputDebugString("Brak config.json, używam domyślnych ustawień", 2)
        return {}
    end
    local data = fromJSON(fileRead(file, fileGetSize(file)))
    fileClose(file)
    outputDebugString("Wczytano konfigurację", 0, 0, 200, 255)
    return data or {}
end

See also