Class CheckpointManager
Manages road checkpoints throughout the game world. Provides control over checkpoint activation and officer assignment.
public static class CheckpointManager
- Inheritance
-
CheckpointManager
- Inherited Members
Remarks
IMPORTANT: The game includes an automatic checkpoint evaluation system that runs every in-game minute. This system may automatically enable checkpoints based on conditions such as:
- Law enforcement intensity level (see LawController)
- Time of day
- Curfew status
- Player distance from checkpoint
Checkpoints require law enforcement intensity >= 5 (default) to activate automatically. Other conditions include: time of day, curfew status, player distance (50+ units), and officer availability. To prevent automatic re-enabling, set intensity to 1-4 using SetIntensityLevel(int).
Methods
DisableAllCheckpoints()
Disables all checkpoints in the game world.
public static void DisableAllCheckpoints()
Remarks
WARNING: The automatic checkpoint evaluation system may re-enable checkpoints based on game conditions. Consider adjusting law enforcement intensity instead.
EnableAllCheckpoints(int)
Enables all checkpoints in the game world.
public static void EnableAllCheckpoints(int officersPerCheckpoint = 2)
Parameters
officersPerCheckpointintThe number of officers to assign to each checkpoint.
GetAllCheckpointInfo()
Gets information about all checkpoints in the game.
public static List<CheckpointInfo> GetAllCheckpointInfo()
Returns
- List<CheckpointInfo>
A list of CheckpointInfo objects for all checkpoint locations.
GetAssignedOfficerCount(CheckpointLocation)
Gets the number of officers currently assigned to a checkpoint.
public static int GetAssignedOfficerCount(CheckpointLocation location)
Parameters
locationCheckpointLocationThe checkpoint location to query.
Returns
- int
The number of assigned officers, or 0 if the checkpoint is not found.
GetAssignedOfficers(CheckpointLocation)
Gets the NPCs (police officers) currently assigned to a checkpoint.
public static List<NPC> GetAssignedOfficers(CheckpointLocation location)
Parameters
locationCheckpointLocationThe checkpoint location to query.
Returns
- List<NPC>
A list of NPCs assigned to the checkpoint, or an empty list if none.
GetCheckpointInfo(CheckpointLocation)
Gets comprehensive information about a checkpoint's current state.
public static CheckpointInfo GetCheckpointInfo(CheckpointLocation location)
Parameters
locationCheckpointLocationThe checkpoint location to query.
Returns
- CheckpointInfo
A CheckpointInfo object containing state information, or null if the checkpoint is not found.
GetCheckpointPosition(CheckpointLocation)
Gets the world position of a checkpoint.
public static Vector3 GetCheckpointPosition(CheckpointLocation location)
Parameters
locationCheckpointLocationThe checkpoint location to query.
Returns
- Vector3
The checkpoint's position in world space, or Vector3.zero if not found.
IsCheckpointEnabled(CheckpointLocation)
Checks if a checkpoint at the specified location is currently enabled.
public static bool IsCheckpointEnabled(CheckpointLocation location)
Parameters
locationCheckpointLocationThe checkpoint location to check.
Returns
- bool
True if the checkpoint is enabled, false otherwise.
IsGate1Open(CheckpointLocation)
Checks if a checkpoint's first gate is currently open.
public static bool IsGate1Open(CheckpointLocation location)
Parameters
locationCheckpointLocationThe checkpoint location to check.
Returns
- bool
True if gate 1 is open, false otherwise.
IsGate2Open(CheckpointLocation)
Checks if a checkpoint's second gate is currently open.
public static bool IsGate2Open(CheckpointLocation location)
Parameters
locationCheckpointLocationThe checkpoint location to check.
Returns
- bool
True if gate 2 is open, false otherwise.
SetCheckpointEnabled(CheckpointLocation, bool, int)
Enables or disables a checkpoint at the specified location.
public static void SetCheckpointEnabled(CheckpointLocation location, bool enabled, int requestedOfficers = 2)
Parameters
locationCheckpointLocationThe checkpoint location to modify.
enabledboolWhether to enable or disable the checkpoint.
requestedOfficersintThe number of officers to assign to the checkpoint when enabling.
Remarks
Officers will be pulled from the nearest police station.
If insufficient officers are available, fewer than requested may be assigned.
WARNING: The automatic checkpoint evaluation system may re-enable disabled checkpoints based on game conditions. See CheckpointManager remarks for details.