Skip to content

playerCheatSuspicionRequest

Asks your gamemode when the server suspects a player of cheating. Without an answer the player is kicked.

Renamed in 0.28 from cheatSuspectRequest; see renamed names.

server.on("playerCheatSuspicionRequest", ({ player, checkName, suspicionScore, details }) => "kick" | "ban" | "ignore" | void | Promise<"kick" | "ban" | "ignore" | void>)
Name Type Description
player PlayerSnapshot The suspected player.
checkName string A short name for what the server saw, for your log.
suspicionScore number How strongly the server suspects the player.
details string More about what the server saw, for your log.
Answer Effect
"kick" The player is disconnected with the reason “cheat suspected (checkName)”.
"ban" The player is banned by network address with the same reason, then disconnected.
"ignore" The player stays.

The first handler that returns one of these decides. No answer, another value or an error kicks the player. See how decisions work.

Keep admins, ban repeat offenders.

gamemodes/freeroam.ts
import { server } from "nativemp";
const admins = new Set(["Alice"]);
const warned = new Set<string>();
server.on("playerCheatSuspicionRequest", ({ player, checkName }) => {
if (admins.has(player.name)) return "ignore";
if (warned.has(player.name)) return "ban";
warned.add(player.name);
server.log(`${player.name} kicked for ${checkName}`);
return "kick";
});