AntiCheat Exports
This section covers the exports for the AntiCheat.
WX AntiCheat includes a set of exports that you can use to interact with the AntiCheat. All of these exports are server-sided.
Make sure to replace wx_anticheat
with the actual name of the AntiCheat resource.
Ban
- Bans a player from the server.
server.lua
exports["wx_anticheat"]:ban(
playerId, -- [[ integer]]
reason -- [[ string ]]
)
Example
server.lua
exports["wx_anticheat"]:ban(1, "Trying to cheat")
Whitelisting Players
- Whitelists a player for a specific amount of time. The time is in milliseconds. While whitelisted, the player won't be able to be detected by the AntiCheat. Set the time to
-1
for no timeout.
server.lua
exports["wx_anticheat"]:whitelistPlayer(
playerId, -- [[ integer]]
time -- [[ string ]]
)
Example
server.lua
exports["wx_anticheat"]:whitelistPlayer(1, 15 * 60 * 1000)
Remove Whitelists
- Removes already whitelisted player from whitelist.
server.lua
exports["wx_anticheat"]:removeWhitelist(
playerId, -- [[ integer]]
)
Example
server.lua
exports["wx_anticheat"]:removeWhitelist(1)
Adding admins
- Adds an admin to the AntiCheat. If the server restarts, the admin will be removed.
server.lua
exports["wx_anticheat"]:addAdmin(
playerId, -- [[ integer]]
)
Example
server.lua
exports["wx_anticheat"]:addAdmin(1)
Removing admins
- Removes an admin from the AntiCheat.
server.lua
exports["wx_anticheat"]:removeAdmin(
playerId, -- [[ integer]]
)
Example
server.lua
exports["wx_anticheat"]:removeAdmin(1)