Scripting/Server/Events/onPlayerCheat

(v0.4.9+) Anti-cheat: a detection fired for this player, and YOU decide what happens (KickPlayer, BanPlayer, a warning, nothing). Without this function the server kicks the player ("cheats were detected on your game") and writes the detection id to the console. detectionID is one of CHEAT_CLEO 1, CHEAT_DEBUGGER 2, CHEAT_WINDOW_TITLE 3, CHEAT_MEMORY 4 (game or client code modified in memory), CHEAT_SPEED_CLIENT 5 and CHEAT_SPEED_SERVER 6 (speed hack), CHEAT_HEALTH 7, CHEAT_ARMOUR 8 (rose without the server / the game giving it: player.Health / Armour, spawns and respawns, an Ambulance for health, an Enforcer for armour), CHEAT_WEAPON 9 (a weapon the server never gave), CHEAT_AMMO 10 (more ammo than the server gave) and CHEAT_HARDWARE_BREAKPOINT 11. GetCheatName(id) gives a text. The same detection repeats at most every 5 s. server.conf ac_exclude switches detections off. File hashes are not part of it: use player.CheckFileHash.

Syntax

onPlayerCheat(player, detectionID)

Arguments

Example

function onPlayerCheat( player, detectionID )
{
	MessagePlayer( "onPlayerCheat fired", player );
}

This sample was generated from the signature – adapt the values to your gamemode.

Section: Spawning, deaths and combat

Categories: Server events | Spawning, deaths and combat