This repository has been archived on 2025-12-11. You can view files and clone it, but cannot push or open issues or pull requests.
UIRP-5M/resources/[system]/monitor/docs/custom-server-log.md
2025-03-17 13:54:06 +01:00

1.0 KiB

Logging Extra Data

This feature allows you to add logging for custom commands like /car and /tp.
To do that, you will need to edit the scripts of those commands to trigger a txaLogger:CommandExecuted event.

Note: for now this only supports client commands!

How to Enable

In the client script, add the following event call inside the command function:

TriggerServerEvent('txaLogger:CommandExecuted', rawCommand)

Where rawCommand is a variable containing the full command with parameters.
You don't NEED to pass rawCommand, you can edit this string or pass anything you want.

Example

In this example, we will log data from the /car command from the CarCommand script.

RegisterCommand('car', function(source, args, rawCommand)
    TriggerServerEvent('txaLogger:CommandExecuted', rawCommand) -- txAdmin logging Callback

    local x,y,z = table.unpack(GetOffsetFromEntityInWorldCoords(PlayerPedId(), 0.0, 8.0, 0.5))

    -- there is more code here, no need to edit
end)