Refactor txAdminLogs to modular, configurable system

Replaces the old txAdminLogs implementation with a modular, table-driven system. Adds new files (fxmanifest.lua, main.lua, settings.lua, utils.lua) and removes the previous monolithic scripts. Logging is now fully configurable via settings.lua, supports per-event webhooks, and features improved formatting and timestamp handling. Updates README with new installation and configuration instructions.
This commit is contained in:
Joost H
2026-02-01 00:45:55 +01:00
parent 36d6c7b77a
commit 8bade2ad95
8 changed files with 151 additions and 138 deletions

View File

@@ -1,8 +1,32 @@
# txAdminLogs
Simple Standalone txAdmin Logs made for FiveM
# 🛠️ txAdminLogs
A lightweight, standalone logging system for FiveM that automatically captures and routes **txAdmin** events to Discord.
Drag and drop installation, just add the line below to your server.cfg / resources.cfg
---
`ensure txAdminLogs`
## ✨ Features
* **Zero Maintenance:** Automatically registers listeners for every event defined in your settings.
* **Dual-Routing:** Sends logs to specific category channels (e.g., Bans, Whitelist) while simultaneously maintaining a "Master Log" for full history.
* **Smart Tables:** Automatically flattens complex data (like Player Identifiers) into clean, bulleted lists.
* **Dynamic Timestamps:** Converts expiration Unix codes into human-readable, localized Discord time (e.g., "in 2 days").
* **Standalone:** No framework requirements. Works on any server.
Feel free to modify for personal usage, don't ever distribute it for any amount of money.
---
## 🚀 Installation
1. Drop the `txAdminLogs` folder into your `resources` directory.
2. Open `settings.lua` and replace `'WEBHOOK'` with your actual Discord Webhook URLs.
3. Add `ensure txAdminLogs` to your `server.cfg`.
---
## ⚙️ Configuration
The system uses a simple table structure in `settings.lua`.
* **MasterWebhook:** The catch-all channel.
* **Webhooks Table:**
```lua
['playerBanned'] = {
color = 10038562,
title = '🔨 txAdmin: Player Banned',
webhook = 'YOUR_SPECIFIC_URL'
}