Scripting/Server/Events/onPlayerCommitCrime

The player's game was about to give them wanted stars (v0.1.9+). Clients no longer raise their own wanted level - the server decides. crimeid is the engine crime type: CRIME_POSSESSION_GUN (1), CRIME_HIT_PED (2), CRIME_HIT_COP (3), CRIME_SHOOT_PED (4), CRIME_SHOOT_COP (5), CRIME_STEAL_CAR (6), CRIME_RUN_REDLIGHT (7), CRIME_RECKLESS_DRIVING (8), CRIME_SPEEDING (9), CRIME_RUNOVER_PED (10), CRIME_RUNOVER_COP (11), CRIME_SHOOT_HELI (12), CRIME_PED_BURNED (13), CRIME_COP_BURNED (14), CRIME_VEHICLE_BURNED (15), CRIME_DESTROYED_CESSNA (16). The same crime is reported at most about 2.5 times per second. Return nothing / false / 0 to decide yourself (e.g. player.Wanted = player.Wanted + 1). Return true / 1 to let the game apply that crime with its own chaos and level rules - the server's stored level follows what the game reached. Without a handler nobody ever gets wanted stars from crimes.

Syntax

onPlayerCommitCrime(player, crimeid)

Arguments

Example

function onPlayerCommitCrime( player, crimeid )
{
	MessagePlayer( "onPlayerCommitCrime fired", player );
}

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

Section: Traffic events

Categories: Server events | Traffic events