Thank you for choosing CodeWorkers.io BanSystem! We're excited to see how it elevates your system. We hope you like it!
The CodeWorkers.io BanSystem provides a comprehensive solution for managing bans and player restrictions on your server. This guide will walk you through the configuration process and usage of the BanSystem.
A Steam Web API key is essential for FiveM authentication. Follow these steps to obtain and activate your key:
set steam_webApiKey "YOUR_KEY_HERE"
ConnectCard.json
file and ensure not to remove the existing brackets [] - simply paste your created code between these brackets.The config_sv.lua
file contains the primary configuration parameters for the BanSystem and is not accessible from the client.
BanSystem.Config.ConnectCardAllowed = false
BanSystem.Config.GroupACE = 'command.cw_bansystem'
BanSystem.Config.PasswordCardAllowed = false
BanSystem.Config.Password = ''
BanSystem.Config.BanIDPrefix = 'CW-'
BanSystem.Config.BanIDLength = 5
BanSystem.Config.DiscordLogURL = ''
The config_sh.lua
file contains various configuration parameters for the BanSystem.
Config = {
BanCommand = 'ban',
BanCommandInfo = "[ID]",
UnbanCommand = 'unban',
UnbanCommandInfo = "[BanID]",
TempBanCommand = 'tempban',
TempBanCommandInfo = "[ID] [HOURS]",
DiscordLogName = 'CodeWorkers.io | BanSystem Logs',
DiscordLogFooter = "CodeWorkers.io [TOOLS]",
DiscordURL = "",
},
Language = {
Infomation = "Information",
Password = "Password",
ConnectionError = "Something is not right with your connection!",
PermissionError = "You cannot use this function",
Usage = "Usage:",
WrongID = "Invalid player ID.",
WrongBanID = "Invalid ban ID.",
WrongIDorTime = "Invalid player ID or duration.",
PlayerBanHour = "Player has been banned for %s hour.",
PlayerBanHours = "Player has been banned for %s hours.",
YourBannedHour = "You have been banned for %s hour.",
YourBannedHours = "You have been banned for %s hours.",
YourBanned = "You have been banned.",
PlayerBan = "Player successfully banned!",
PlayerBanError = "Error banning player.",
PlayerUnban = "Player successfully unbanned!",
PlayerUnbanError = "Error lifting player's ban.",
Loading = "Please wait, your connection is being checked...",
BanInfoText = "You are banned!\nBan ID: ",
BanTimeText = "\nRemaining time: %02d:%02d:%02d",
LicenseError = "FiveM error. Please restart FiveM!",
DiscordError = "No Discord ID found. Please start Discord and reconnect!",
SteamError = "No Steam ID found. Please start Steam and restart FiveM!",
WrongPassword = "Error: Invalid password entered!",
OnlyAttempts = "Error: Invalid password entered! (%s attempts remaining!)",
MaximumAttempts = "You've exceeded the maximum attempts. Please try again later.",
DiscordLogKick = "Player kicked ID: ",
DiscordLogBan = "A player has been banned",
DiscordLogUnban = "A player has been unbanned",
DiscordLogTempBan = "A player has been temporarily banned",
DiscordLogTempHours = "Hours: "
},
-- Notification function for server-side admin commands, prints a message
Notify = function(msg)
print(msg) -- Prints the message on the client console and in their chat
end
The following export functions are available for usage:
exports.CW_BanSystem:AddBAN(license, steamid, discord)
: Bans a player based on their
license, Steam ID, and Discord ID.exports.CW_BanSystem:RemoveBAN(banID)
: Removes a ban based on the ban ID.exports.CW_BanSystem:AddBANTime(license, steamid, discord, durationInHours)
: Adds time to an
existing ban based on the player's license, Steam ID, and Discord ID.exports.CW_BanSystem:ByePlayer(player, reason)
: Kicks a player with a specified reason.exports.CW_BanSystem:CheckIDS(source)
: Checks player identifiers and returns a table with
identifiers.
exports.CW_BanSystem:AddBAN('license123', 'steam:123456789', 'discord:123456789012345678')
exports.CW_BanSystem:RemoveBAN('CW-ABCDE')
exports.CW_BanSystem:AddBANTime('license123', 'steam:123456789', 'discord:123456789012345678', 24)
exports.CW_BanSystem:ByePlayer('player123', 'Hacking')
local identifiers = exports.CW_BanSystem:CheckIDS(source)
local identifiers = {
steamid = nil,
license = nil,
discord = nil,
xbl = nil,
liveid = nil,
ip = nil
}
If you require further assistance or have any queries, please don't hesitate to reach out. We hope you find using CodeWorkers.io BanSystem a delightful experience!