Table of Contents

Class LawManager

Namespace
S1API.Law
Assembly
S1API.dll

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

int

DispatchOfficerCount

The default number of officers dispatched when police are called.

public static int DispatchOfficerCount { get; }

Property Value

int

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

float

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

float

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

float

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

float

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

float

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

float

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

float

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

target Player

The 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

target Player

The 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

target Player

The 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

target Player

The 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

routeName string

The 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

routeName string

The 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

target Player

The 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

target Player

The 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

target Player

The 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

target Player

The 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

target Player

The player to set the wanted level for.

level PursuitLevel

The 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

route FootPatrolRoute

The foot patrol route to use.

requestedMembers int

The 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

route VehiclePatrolRoute

The 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.