Class LawManager
Provides access to law enforcement and police dispatch functionality. Manages police responses, patrol operations, and wanted levels.
public static class LawManager
- Inheritance
-
LawManager
- Inherited Members
Properties
ActiveOfficerCount
Gets the total number of active police officers currently in the game world.
public static int ActiveOfficerCount { get; }
Property Value
DispatchOfficerCount
The default number of officers dispatched when police are called.
public static int DispatchOfficerCount { get; }
Property Value
DispatchVehicleUseThreshold
The distance threshold (in units) above which dispatched officers will use a vehicle. Below this threshold, officers will respond on foot.
public static float DispatchVehicleUseThreshold { get; }
Property Value
EscalationTimeArresting
Time in seconds before pursuit escalates from Arresting to NonLethal if the player remains visible to police.
public static float EscalationTimeArresting { get; }
Property Value
EscalationTimeNonLethal
Time in seconds before pursuit escalates from NonLethal to Lethal if the player remains visible to police.
public static float EscalationTimeNonLethal { get; }
Property Value
SearchTimeArresting
Search time in seconds for Arresting pursuit level. Police will search for this long after losing sight of the player.
public static float SearchTimeArresting { get; }
Property Value
SearchTimeInvestigating
Search time in seconds for Investigating pursuit level. Police will search for this long after losing sight of the player.
public static float SearchTimeInvestigating { get; }
Property Value
SearchTimeLethal
Search time in seconds for Lethal pursuit level. Police will search for this long after losing sight of the player.
public static float SearchTimeLethal { get; }
Property Value
SearchTimeNonLethal
Search time in seconds for NonLethal pursuit level. Police will search for this long after losing sight of the player.
public static float SearchTimeNonLethal { get; }
Property Value
Methods
CallPolice(Player)
Dispatches police officers to pursue the specified player for a crime. Officers will be sent from the nearest police station.
public static void CallPolice(Player target)
Parameters
targetPlayerThe player who committed the crime and will be pursued.
Remarks
This method will not dispatch police during tutorial mode. The number of officers dispatched is determined by DispatchOfficerCount. Officers will use vehicles if the distance exceeds DispatchVehicleUseThreshold.
ClearWantedLevel(Player)
Clears the wanted level for the specified player, ending any active pursuit.
public static void ClearWantedLevel(Player target)
Parameters
targetPlayerThe player to clear the wanted level for.
Remarks
This sets the pursuit level to None and clears all crimes from the player's record.
DeescalateWantedLevel(Player)
Decreases the wanted level for the specified player by one level.
public static void DeescalateWantedLevel(Player target)
Parameters
targetPlayerThe player to de-escalate the wanted level for.
Remarks
Progression: Lethal → NonLethal → Arresting → Investigating → None. This is a convenience method that calls Deescalate().
EscalateWantedLevel(Player)
Increases the wanted level for the specified player by one level.
public static void EscalateWantedLevel(Player target)
Parameters
targetPlayerThe player to escalate the wanted level for.
Remarks
Progression: None → Investigating → Arresting → NonLethal → Lethal. This is a convenience method that calls Escalate().
FindFootPatrolRoute(string)
Finds a foot patrol route in the scene by name.
public static FootPatrolRoute FindFootPatrolRoute(string routeName)
Parameters
routeNamestringThe name of the patrol route to find.
Returns
- FootPatrolRoute
The FootPatrolRoute wrapper, or null if not found.
FindVehiclePatrolRoute(string)
Finds a vehicle patrol route in the scene by name.
public static VehiclePatrolRoute FindVehiclePatrolRoute(string routeName)
Parameters
routeNamestringThe name of the patrol route to find.
Returns
- VehiclePatrolRoute
The VehiclePatrolRoute wrapper, or null if not found.
GetAllFootPatrolRoutes()
Gets all foot patrol routes currently in the scene.
public static FootPatrolRoute[] GetAllFootPatrolRoutes()
Returns
- FootPatrolRoute[]
An array of FootPatrolRoute wrappers.
GetAllVehiclePatrolRoutes()
Gets all vehicle patrol routes currently in the scene.
public static VehiclePatrolRoute[] GetAllVehiclePatrolRoutes()
Returns
- VehiclePatrolRoute[]
An array of VehiclePatrolRoute wrappers.
GetWantedLevel(Player)
Gets the current wanted level (pursuit level) for the specified player.
public static PursuitLevel GetWantedLevel(Player target)
Parameters
targetPlayerThe player to get the wanted level for.
Returns
- PursuitLevel
The player's current pursuit level.
IsLethalForceAuthorized(Player)
Checks if police are authorized to use lethal force against the player.
public static bool IsLethalForceAuthorized(Player target)
Parameters
targetPlayerThe player to check.
Returns
- bool
True if the player's wanted level is at Lethal.
IsPlayerWanted(Player)
Checks if the player is currently in an active police pursuit.
public static bool IsPlayerWanted(Player target)
Parameters
targetPlayerThe player to check.
Returns
- bool
True if the player has any wanted level above None.
IsUnderInvestigation(Player)
Checks if the player is currently being investigated by police. This includes all pursuit levels except None.
public static bool IsUnderInvestigation(Player target)
Parameters
targetPlayerThe player to check.
Returns
- bool
True if police are actively pursuing or investigating the player.
SetWantedLevel(Player, PursuitLevel)
Sets the wanted level (pursuit level) for the specified player.
public static void SetWantedLevel(Player target, PursuitLevel level)
Parameters
targetPlayerThe player to set the wanted level for.
levelPursuitLevelThe pursuit level to set.
Remarks
Setting to None will clear all crimes and end the pursuit. This is a convenience method that calls SetPursuitLevel(PursuitLevel).
StartFootPatrol(FootPatrolRoute, int)
Starts a foot patrol using the specified route and number of officers. Officers are pulled from the nearest police station to the route's starting point.
public static PatrolGroup StartFootPatrol(FootPatrolRoute route, int requestedMembers = 2)
Parameters
routeFootPatrolRouteThe foot patrol route to use.
requestedMembersintThe number of officers to assign to the patrol.
Returns
- PatrolGroup
A PatrolGroup object representing the active patrol, or null if insufficient officers are available.
Remarks
If insufficient officers are available at the nearest police station, the patrol will not be created. Use FindFootPatrolRoute(string) to locate existing patrol routes in the scene.
StartVehiclePatrol(VehiclePatrolRoute)
Starts a vehicle patrol using the specified route. One officer is pulled from the nearest police station and assigned a patrol vehicle.
public static bool StartVehiclePatrol(VehiclePatrolRoute route)
Parameters
routeVehiclePatrolRouteThe vehicle patrol route to use.
Returns
- bool
True if the patrol was started successfully, false otherwise.
Remarks
If no officers are available at the nearest police station, the patrol will not be created. Use FindVehiclePatrolRoute(string) to locate existing patrol routes in the scene. The assigned officer will automatically patrol the route with a police vehicle.