Skip to content

RUNE0013/sws-report

 
 

Repository files navigation

SWS Report

Build License Version Lua TypeScript FiveM

Standalone report system for FiveM with live chat, admin tools, and Discord integration.


Preview

Admin View Player View
Admin View Player View
More Screenshots
Statistics Dashboard
Admin Notes Player Notes
Admin Notes Player Notes

Features

  • Player Reports - Create tickets with live chat support
  • Voice Messages - Record and send audio messages in chat (optional)
  • Admin Panel - Claim, resolve, and manage reports
  • Moderation Tools - Teleport, heal, freeze, spectate, kick
  • Discord Integration - Webhook logging for all events
  • Statistics Dashboard - Track team performance
  • Inventory Management - View/modify player items (ox_inventory, ESX)
  • Multi-Language - English & German included
  • Dark/Light Theme - User preference saved

Requirements


Quick Start

# 1. Clone to resources
git clone https://github.com/SwisserDev/sws-report.git resources/sws-report

# 2. Import database
mysql -u root -p your_database < resources/sws-report/sql/install.sql

# 3. Build UI
cd resources/sws-report/web && npm install && npm run build

# 4. Add to server.cfg
ensure oxmysql
ensure sws-report

# 5. (Optional) Enable voice messages
mysql -u root -p your_database < resources/sws-report/sql/migrate_voice_messages.sql

# 6. (Optional) Enable inventory management
mysql -u root -p your_database < resources/sws-report/sql/migration_1.0.6_inventory_changes.sql

Upgrading from an older version? See UPGRADING.md


Configuration

Edit config/main.lua:

Config.Locale = "en"              -- Language (en/de)
Config.Command = "report"         -- Command to open UI
Config.Cooldown = 60              -- Seconds between reports
Config.MaxActiveReports = 3       -- Max open reports per player

-- Admin access (choose one or both)
Config.AdminAcePermission = "report.admin"
Config.AdminIdentifiers = {
    "license:abc123...",
    "steam:123456..."
}

-- Discord webhook
Config.Discord = {
    enabled = true,
    webhook = "https://discord.com/api/webhooks/..."
}

-- Voice Messages (optional, requires migration)
Config.VoiceMessages = {
    enabled = true,
    maxDurationSeconds = 60,
    maxFileSizeKB = 7500
}

-- Inventory Management (optional, requires migration)
Config.Inventory = {
    enabled = true,
    allowedActions = { add = true, remove = true, set = true, metadata_edit = true },
    maxItemCount = 1000
}

Commands & Exports

Commands

Command Description
/report Open report interface

Server Exports

exports["sws-report"]:IsAdmin(source)
exports["sws-report"]:GetReports(filter)
exports["sws-report"]:CloseReport(reportId)
exports["sws-report"]:IsInventoryAvailable()
exports["sws-report"]:GetInventorySystemName()

Client Exports

exports["sws-report"]:OpenUI()
exports["sws-report"]:CloseUI()
exports["sws-report"]:IsUIOpen()

Events

AddEventHandler("sws-report:onCreated", function(report) end)
AddEventHandler("sws-report:onClaimed", function(report, adminId) end)
AddEventHandler("sws-report:onResolved", function(report, adminId) end)

Documentation

Document Description
INVENTORY.md Inventory management setup, usage & custom adapters
UPGRADING.md Migration guide for version upgrades

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/thing)
  3. Commit changes (git commit -m "Add thing")
  4. Push to branch (git push origin feature/thing)
  5. Open a Pull Request

License

MIT


Built by SwisserDev

MetricsWinCloud

About

No description, website, or topics provided.

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Lua 56.1%
  • TypeScript 40.6%
  • JavaScript 2.5%
  • CSS 0.8%