This script allows you to follow what happened in your server directly in game. It logs the connections / disconnections (with the reason), the kills, when a player enter in a blacklisted vehicle and when he takes a blacklisted weapon and a chat log.
Drop the logsystem folder into your resources folder.
Configure the script thanks to the config.lua file.
For chat logs, you’ve got to add a line in the chat script. In the cl_chat.lua file change the chatResult callback to add the logs:logChat trigger as here :
RegisterNUICallback('chatResult', function(data, cb)
chatInputActive = false
SetNuiFocus(false)
if not data.canceled then
local id = PlayerId()
--deprecated
local r, g, b = 0, 0x99, 255
TriggerServerEvent("logs:logChat", data.message)
if data.message:sub(1, 1) == '/' then
ExecuteCommand(data.message:sub(2))
else
TriggerServerEvent('_chat:messageEntered', GetPlayerName(id), { r, g, b }, data.message)
end
end
cb('ok')
end)
Add start logsystem into your server.cfg.
Enjoy it !
Changelogs
Version 0.0.5
Improved communication between the server and the clients
Improved loops (12ms to 0.05/4ms)
Removing some unnecessary pieces of code
Version 0.0.4
Added darkmode to the UI
Added command logs (Have to change the chat script)
Added brazilian language thanks to Sattagames
Version 0.0.3
Fixed UI issues
Allows to rename the script (without capital letters)
Added chat logs
Added more configurable things (strings/strings.lua)
Got a bug where the UI doesn’t close down properly after pressing the close in the top corner, the interface disappears however the mouse control doesn’t, a quick fix to this would be appreciated
Thank you for taking the time to write an extremely useful script. I’ve noticed that it does not log /ooc messages or any other form of chat messages other than basic chat. Is it possible to include and log these elements so all forms of chat will be logged?