For Developers
hooks:
- LSAC.punishments.CustomBan(ply, sid64, sid32, nick, reason, bantime, module, confidencescore, logonly, kickonly, extrainformation) - Incase you have a custom banning routine
- LSAC.punishments.PunishUser(ply, sid64, nick, reason, bantime, module, confidencescore, action, extrainformation) - Incase you have a custom punishment routine
- LSAC.logs.CreatePlayerLog(ply, module, reason, kickonly, logonly) - Called when we start to create a log
- LSAC.logs.CreatePlayerLog.ShouldAddDelayedInformation(ply, module, reason, kickonly, logonly, counter) - Should we add delayed information for this players log?
- LSAC.logs.CreatePlayerLog.FetchDelayedInformation(ply, module, reason, kickonly, logonly, counter) - The delayed information (i.e. a dump of the players lua)
- LSAC.logs.CreatePlayerLog.Done(ply, steamid64, module, kickonly, logonly, counter) - Called when the delayed information etc has been fetched and log is savedf
- LSAC.menu.InstalledMenu(ply) - Called when the menu is installed on someone
- LSAC.discordintegration.DiscordNotificationImage(ply, sid64, module, reason, kickonly, logonly) - Hook to change the notificationimage for the webhook
- LSAC.OnDetectionToggled(module, active) - Called when a detection gets disabled or enabled
- LSAC.OnPreventionToggled(module, active) - Called when a cheat prevention gets disabled or enabled
- LSAC.userperms.PlayerHasPermission(ply, permission) - Incase you wanna add custom permission handling
- LSAC.ConCmds.IsLegitimateCommand(ply, cmd)- Incase you wanna whitelist a command
fns:
- LSAChookAddOverwrite (overwrite before ac runs) - implement own handler
- LSAC.detections:Register(name, default_disabled, extras) - register your own detections
- LSAC.infractions:TriggerInfraction(ply, registeredmodule,, accuracy, logonly, kickonly, extrainfo) - trigger your own detections
- LSAC.cheatpreventions:Register(name, default_disabled, extras) - register your own cheat preventions
- LSAC:SetConVarCheck(convarName, expectedValue) - force a ConVar to have a specific value (requires Sourcenet3 and Player ConVar Check) [if convarValue is "matchserver" then it will always match the same value that it's set to on the server]
- LSAC:SetCommandCheckFunction(fn) - use your own function for the Command Checker
toggles:
- LSAChookNoPCall (set before ac runs) - don't log errors etc but a bit more perf (should not be needed)
- LSAC.detections:ExtAddonIgnorePlayer(ply, key, val) - do not scan this player for val seconds, key is used to identify which addon or addon part is responsible ALWAYS call it with nil as value after manually after if your seconds are large
Explanations
LSAChookAddOverwrite can be used incase you want to implement your own handler for the anticheats hooks. The AntiCheat by default has its own hook routine which is basically just like my own hook.Call. When you create the LSAChookAddOverwrite global, the function gets called like a hook.Add but for the acs funcs. So for every detection, cheatprevention etc the AC will call your function with the function it wants to hook e.g. Think and the hook fn e.g. local function callEveryThink() print("hi") end. I offer this in my API so owners of big servers with lots of players can implement their own hook.Call-like things which for example only make the AntiCheat scan one specific player or certain players in chunks (e.g. only 10 or 20 at once and switching every minute).
LSAC.detections:Register and LSAC.cheatpreventions:Register share the same interface. Extras can be set if you want a callback to be called before the CheatPrevention or Detection is registered. This is useful incase of e.g. let's say wanting to overwrite some of the default AntiCheat module functionality (like, e.g. making something which can not be disabled in settings). default_disabled just means whether it should be disabled by default. If you set this to true when registering one, then it's disabled by default and needs to be enabled in the menu by the user themselves. Then, about name, that's just the name of the module you wanna register. E.g. MyOwnAimbotDetection.
When calling LSAC.detections:Register or LSAC.cheatpreventions:Register you get a new module. The API supports: module:AddSetting(name, type, defaultvalue, description, callbackOnChanged), module:IsEnabled, module:GetSetting (for getting a setting you've added, I recommend using the callBackOnChanged). Then there's also module:SetEnabled for enabling/disabling a module, module:AddHook (is like hook.Add but without a custom name) and module:SetDescription for setting a modules description. Lastly there's module:IsVolatile(ply) to check whether a player is stable/should be scanned for cheats. This is only ever important for detections which depend on stuff like checking players movements
LSAC.infractions:TriggerInfraction(ply, registeredmodule,, accuracy, logonly, kickonly, extrainfo) - trigger your own detections
you can call this with a player, the module you got from detections:Register or cheatpreventions:Register, how sure you are that this is accurate (0% to 100%), whether it should only write to logs, whether it should only kick the player and lastly extra information incase there's some specific information like "he was looking left" or w.e.