RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Ambient SoundUI Apps ManagerUI AudioBindings LegendCamera Distance AppDeveloper ConsoleCredits MusicExternal WebSocket ServerFade ScreenGame BlurGameplay App ContainersGrid SelectorLivery EditorMessages DebuggerMessages/Tasks App ContainersMission InfoPolice InfoTop BarUI ModsNavigation Map DataVehicle Paint EditorVehicle Vicinity AppUI Visibility

UI

Resources

BeamNG Game Engine Lua Cheat SheetGE Developer RecipesMCP Server Setup

// RLS.STUDIOS=true

Premium Mods for BeamNG.drive. Career systems, custom vehicles, and immersive gameplay experiences.

Index

HomeProjectsPatreon

Socials

DiscordPatreon (RLS)Patreon (Vehicles)

© 2026 RLS Studios. All rights reserved.

Modding since 2024

API ReferenceGE Extensionsui

Police Info

Sends police pursuit data to the UI HUD every frame.

Sends police pursuit data to the UI HUD every frame.


Overview

ui_policeInfo reads the player vehicle's pursuit state from gameplay_police and pushes it to the CEF UI via the PoliceInfoUpdate guihook. It displays pursuit level, sight value, arrest/evade progress, duration, police count, and offense alerts.

Extension path: lua/ge/extensions/ui/policeInfo.lua


Exports (M)

FunctionSignatureDescription
onGuiUpdate(dt)Called each GUI frame; sends pursuit data to UI.
onVehicleSwitched(_, id)Resets pursuit display when player switches vehicle.
onPursuitOffense(vehId, name, data)Fires a one-frame offense alert for the player vehicle.

Fields

FieldTypeDefaultDescription
M.enabledbooltrueMaster toggle; when false, no data is sent.

Internals

lastPursuitData

{
  pursuitLevel = 0,  -- pursuit mode (0 = none)
  sightValue   = 0,  -- police sight/detection value
  arrest       = 0,  -- arrest timer progress (lerped)
  evade        = 0,  -- evade timer progress (lerped)
  info         = '',  -- array of {txt, key} or empty string
  alert        = '',  -- one-frame offense alert or nil
}

Info Fields

When pursuit is active (mode > 0), info is an array of:

  • {txt, key='duration'} - formatted as MM:SS
  • {txt, key='policeCount'} - number of police units
  • {txt, key='uniqueOffensesCount'} - unique infractions

Lerped Progress

arrest and evade are smoothed with lerp(..., 0.5) to animate the progress bar nicely in the UI, especially when values reset to zero.


How It Works

  1. Each GUI frame, onGuiUpdate checks gameplay_police.getPursuitData().
  2. If no pursuit exists, resets to zero if needed.
  3. Otherwise updates pursuit level, sight, arrest/evade (lerped), and info fields.
  4. Triggers PoliceInfoUpdate with the data table.
  5. Clears alert after one frame (it's a ping).

Lua Examples

-- Disable police HUD
extensions.ui_policeInfo.enabled = false

-- Re-enable
extensions.ui_policeInfo.enabled = true

Hooks Triggered

HookPayloadWhen
PoliceInfoUpdate (guihook)lastPursuitDataEvery GUI frame during pursuit

Additional Exports

The following exports are available but not yet documented in detail:

  • M.onGuiUpdate
  • M.onPursuitOffense
  • M.onVehicleSwitched

See Also

  • ui/ambientSound - Ambient Sound Stream Player - Related reference
  • UI Apps Manager - Related reference
  • UI Audio - Related reference
  • UI System Guide - Guide

Mission Info

Manages mission info dialogues and activity accept popups in the UI.

Top Bar

Manages the top navigation bar entries, visibility, and active item state.

On this page

OverviewExports (M)FieldsInternalslastPursuitDataInfo FieldsLerped ProgressHow It WorksLua ExamplesHooks TriggeredAdditional ExportsSee Also