Chat Filter Resource (MTA:SA)

Author: greenops011
=================================

This resource filters chat messages based on banned keywords, censors them in public chat, alerts admins with the uncensored message, and logs filtered messages to a MySQL database.

Files included:
- chat_logs.sql   -> SQL schema for the `chat_logs` table (filtered messages only)
- meta.xml        -> Resource manifest
- chat_filter.lua -> Server-side Lua script with filtering, logging, and /checklogs command
- readme.txt      -> Setup and usage instructions

Setup Instructions:
-------------------
1. Database Setup:
   - Import `chat_logs.sql` into your MySQL database:
       mysql -u <username> -p <database> < chat_logs.sql

   - This will create a `chat_logs` table to store filtered messages.

2. Configure Database Connection:
   - Open `chat_filter.lua`
   - Edit the dbConnect line to match your MySQL settings:
       local db = dbConnect("mysql", "dbname=mydb;host=127.0.0.1;port=3306", "username", "password", "share=1")

3. Configure Banned Words:
   - In `chat_filter.lua`, edit the `bannedWords` table:
       local bannedWords = { "badword1", "badword2", "testword", "foo", "bar", "hello" }

4. Configure Admin ACL Group:
   - Default is "Admin". Change if needed:
       local adminACL = "Admin"

5. Installation:
   - Place the `mta_chat_filter_resource` folder into your server's `resources/` directory.
   - Add the resource to `mtaserver.conf` or start it in-game using:
       /start mta_chat_filter_resource

6. Usage:
   - When players type banned words, they are replaced with "*" symbols in chat.
   - Admins see the original uncensored version prefixed with [CENSORED].
   - The original message is logged to the MySQL database.
   - Admins can check logs for a user with:
       /checklogs <username>

   - If no filtered messages exist for that user:
       Good news! <username> has had no messages filtered by the system

Enjoy!
