⚙️Security Config
Discover security options within our resource, protecting against cheaters for an enjoyable gameplay.
In-Depth Explanation
Security.EventPrefix = "cis_cctv"
Assigns a unique base prefix to all events within the system, enhancing security by preventing the execution of unauthorized events.
Security.AuthorizedResources = {
"example",
}
Requires the list of resources that are permitted to trigger events, and security functions (GetEventCode - GetEventPrefix).
Cheating Event Alert
RegisterServerEvent('cis:anticheat:server:alert')
AddEventHandler('cis:anticheat:server:alert', function(message, src)
if(src == nil)then
src = source
end
TriggerEvent(Security.EventPrefix .. ":server:log", message, "cheating")
if(Security.DropPlayer)then
cisAnticheatDropPlayer(src)
end
end)
Checks if the source of the alert (
src
) is specified. If not, it defaults to thesource
variable, which represents the player triggering the event.Logs the alert message by triggering another event, which is prefixed with
Security.EventPrefix
to ensure it's part of the secured event naming convention. The message and a tag indicating "cheating" are passed along for logging purposes.If
Security.DropPlayer
is set totrue
, it proceeds running thecisAnticheatDropPlayer()
function. Sends the player ID.
Drop Player Function
function cisAnticheatDropPlayer(src)
DropPlayer(src, "cis_anticheat: Kicked for cheating. If you believe this is a mistake, please contact the server owner.")
end
The function is designed to disconnect a player from the server when a cheating attempt is detected. The function requires a player's src
(source identifier) as its parameter and uses the DropPlayer
command to remove the player from the game, displaying a message that they were kicked for cheating.
You can customize this function by replacing the DropPlayer
command with a banning method, allowing for more permanent measures against cheating.
Last updated
Was this helpful?