onClientDebugMessage
ClientEventCancellable
Fired on this client for every script line that goes to the log: errors, warnings and messages.
addEventHandler("onClientDebugMessage", root, function(string message, int level, string|nil file, int|nil line) … end)
Handler parameters
| Name | Type | Description |
|---|---|---|
| message | string | The line's text. |
| level | int | 1 error, 2 warning, 3 message (from outputDebugString with another level, print or outputServerLog). |
| file | string|nil | The file the line came from, or the resource's name. nil for messages. |
| line | int|nil | The line in the file. nil when unknown. |
Source
The root element (root).
Cancelling the event keeps the line from being written. What a handler of this event writes does not fire the event again.
Example
addEventHandler("onClientDebugMessage", root, function(message, level, file, line)
if level == 1 then
triggerServerEvent("onClientScriptError", resourceRoot, message, file, line)
end
end)