Welcome to Arad's Setwarn & Anti-Cheat System, a powerful Lua script designed for FiveM servers using the ESX framework. This system allows server admins to manage player warnings and detect potential spoofers with ease, all while integrating seamlessly with your MySQL database and Discord for alerts! ๐
-
Setwarn Command ๐
- Admins can issue warnings to players using their Steam Hex.
- Supports adding, updating, and removing warnings.
- Displays warnings to admins every 5 seconds for active warned players.
- Usage:
/setwarn [SteamHex] [Warn Text]or/setwarn [SteamHex]to remove.
-
Anti-Cheat System ๐
- Monitors player HWIDs to detect potential spoofers.
- Compares player HWIDs against a
banlisttable in the database. - Alerts admins in-game and sends notifications to a Discord webhook when a suspicious player is detected.
-
Database Integration ๐๏ธ
- Stores warnings in a
setwarntable with details like Steam Hex, warning note, admin name, and timestamp. - Supports checking for banned HWIDs in a
banlisttable.
- Stores warnings in a
-
Discord Webhook Alerts ๐ข
- Sends real-time notifications to your Discord server when a spoofer is detected.
-
Clone the Repository ๐ฅ
git clone https://github.com/aradashkan/FiveM-Anti-Spoofer.git
-
Add to Your Server ๐ฅ๏ธ
- Copy the script folder to your server's
resourcesdirectory. - Add
ensure Anti-Spooferto yourserver.cfg.
- Copy the script folder to your server's
-
Set Up the Database ๐๏ธ
- Import the provided
setwarn.sqlfile into your MySQL database to create thesetwarntable. - Ensure your
banlisttable exists with ahwidcolumn for the anti-cheat system.
- Import the provided
-
Configure Discord Webhook ๐
- Replace
"Your_Discord_Webhook_URL_Here"in the script with your actual Discord webhook URL.
- Replace
-
Restart Your Server ๐
- Restart your FiveM server or use
refreshfollowed bystart Anti-Spoofer.
- Restart your FiveM server or use
The script requires a MySQL database with the following tables:
Stores player warnings with details.
CREATE TABLE IF NOT EXISTS `setwarn` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`identifier` varchar(255) NOT NULL,
`note` text DEFAULT NULL,
`admin` varchar(255) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;Stores banned HWIDs for the anti-cheat system (ensure it has a hwid column).
-
Set a Warning:
/setwarn steam:1100001xxxxxxx "Breaking server rules" -
Remove a Warning:
/setwarn steam:1100001xxxxxxx
-
Admin Notifications:
- Admins with
permission_level > 0receive in-game warnings every 5 seconds for active warned players. - Spoofer alerts are sent to admins and Discord when a player's HWID matches a banned one.
- Admins with
- The
/setwarncommand requires admin level 5 (es:addAdminCommandlevel 5). - Only admins with
permission_level > 0receive warning and spoofer alerts.
Contributions are welcome! ๐ Feel free to open issues or submit pull requests to improve the script. Make sure to follow the code style and test your changes.
This project is licensed under the MIT License. See the LICENSE file for details.
- Coded by Aัad ๐ป
- GitHub: aradashkan
Enjoy keeping your FiveM server safe and organized! ๐