Great! For FiveM (GTA V multiplayer mod), anticheat scripts are usually written in Lua (for client/server scripts) or C# (for server-side resources).
OCR-based detection is not practical directly in Lua or C# on FiveM, but keyword detection in resource names, events, or menu triggers is very common and effective.
What you likely want:
- Detect if a player is running a known cheat menu (e.g., resource with "godmode", "menu", "kill", etc. in its name).
- Detect if a player triggers suspicious events (e.g., "godmode", "killPlayer", etc.).
- Kick or ban the player, or log the incident.
1. Resource Name Detection (Lua, Server-Side)
This checks if a player has started a suspicious resource (common for mod menus):
local suspicious_keywords = {
"godmode", "menu", "kill", "aimbot", "esp", "noclip", "teleport", "infinite", "fly", "wallhack", "triggerbot", "cheat", "hack", "modmenu"
}
AddEventHandler('onResourceStart', function(resourceName)
for _, keyword in ipairs(suspicious_keywords) do
if string.find(string.lower(resourceName), keyword) then
print("[AntiCheat] Suspicious resource detected: " .. resourceName)
-- Optionally, stop the resource or take action
-- StopResource(resourceName)
end
end
end)
2. Event Name Detection (Lua, Server-Side)
If a cheater tries to trigger a suspicious event, you can catch it:
local suspicious_events = {
"godmode", "killPlayer", "aimbot", "giveWeapon", "setHealth", "setArmor", "teleport", "noclip"
}
for _, eventName in ipairs(suspicious_events) do
RegisterNetEvent(eventName)
AddEventHandler(eventName, function()
local src = source
print("[AntiCheat] Suspicious event triggered: " .. eventName .. " by player " .. src)
-- Ban, kick, or log the player
DropPlayer(src, "Cheating detected: " .. eventName)
end)
end
3. Resource List Scanning (Lua, Server-Side)
You can periodically scan all running resources for suspicious names:
Citizen.CreateThread(function()
while true do
Citizen.Wait(60000) -- every 60 seconds
for i=0, GetNumResources()-1 do
local resourceName = GetResourceByFindIndex(i)
for _, keyword in ipairs(suspicious_keywords) do
if string.find(string.lower(resourceName), keyword) then
print("[AntiCheat] Suspicious resource running: " .. resourceName)
-- Optionally, stop the resource or take action
end
end
end
end
end)