Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 31 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,33 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),

## [Unreleased]

## [0.9.0-ptb.6] - 2026-11-28

### Added
- Framework support for Qbox, QBCore, ESX Legacy, ox_core and ND_Core. `config/framework.json` maps framework jobs to departments and agencies, and job grades to ranks. With a framework, the character's job decides who can go on duty and at what rank, players show by their character's name, and duty stays in step with Qbox and QBCore. Framework characters get FivePRS records, so citations, warrants, licenses and the MDT work with them, their owned vehicles are found by plate, and citation fines come out of the character's bank. Spawning and clothing are left to the framework. FivePRS still runs standalone when no framework is found
- `xpEnabled` in `config/settings.json` turns XP off, so ranks are only set by admins. The terminal hides XP when it's off
- Patrol car radar with front and rear antennas that read same-direction or oncoming traffic, separate front (`J`) and rear (`U`) locks, closing and away indicators, an error reading while turning or airborne, a doppler tone and beeps, and a digital display. The operator menu (`F9`) sets each antenna, a fast limit with optional auto-lock, volumes, and the display's size and position, and remembers them. A plate reader checks the vehicles in front and behind against records and flags stolen vehicles, wanted owners, suspended licenses and unregistered plates, shows plates in their in-game style, can be locked (`O`), and alerts on plates in each officer's watch list. Officers riding as passengers see the driver's radar and can lock it. A handheld lidar gun measures speed and distance on foot, with its own reticle when aiming; `radar.lidarWeapon` sets the weapon it uses. Every radar lock and lidar reading is kept for 30 days as a speed clock in **Records › Speed**, where an officer can run the plate or start a citation pre-filled with the clock. Settings are under `radar` in `config/settings.json`
- **As I am** in the Duty app starts your shift with your current look and no vehicle. It's the default, and the Duty app remembers the start you used last
- Rename the police, EMS and fire departments and give them your own icons in the new `config/departments/<department>/department.json`, which FivePRS creates on start. The names show everywhere players see a department
- Agencies can have their own `icon`, shown in the Duty app and Dispatch in place of the department's
- **Book suspect** in the station menu at the duty point ends custody once you've brought your suspect in. Press `H` on foot beside your vehicle to take a suspect back out first. Resources can listen for `FivePRS:Local:SuspectBooked`
- Callout helpers `WaitForArrivalAsync`, `WaitUntilWitnessedAsync` and `CanSee`, with the standard `SpawnDistance`, `SightDistance` and `CloseDistance`

### Changed
- `jurisdictions.json` is checked one entry at a time. A territory or agency with a mistake is skipped with a console warning that says what's wrong, and the rest of the file loads, instead of the whole file falling back to the defaults. Agencies can be added with any id and name
- Department names in config files are no longer case-sensitive, and a department's display name works too, so `"department": "carabinieri"` is accepted once police is renamed to Carabinieri
- A framework job mapped to an agency no longer needs a `department`; it comes from the agency
- `fprs_setdept` accepts a department's display name as well as `police`, `ems` or `fire`
- Callouts set up their scene when you're about 150 m away, and start the action (a fight, a getaway or a pursuit) once you can see it or are within 15 m

### Fixed
- Shoplifting no longer ends as soon as it's accepted when the store is more than 300 m away. The suspect waits near the store and runs once you find them. Thanks to phoenixpinpoint for the first fix (#11)
- Vehicle Pursuit no longer starts the chase before you're near. You're sent to where the stolen car was last seen; it drives normally until you're close, then flees
- Domestic Disturbance no longer ends early because the people at the scene spawned far away and fell through the map, and the fight no longer finishes before you arrive. Verbal arguments stay verbal
- Arrested suspects no longer get stuck in a loop between the cuffed pose and following you. They walk with you while cuffed
- Pulled-over vehicles no longer drive off in a loop to a point on another road before stopping. They pull to the side of their own road, or stop where they are
- Starting a shift at a **Station** now gives you your uniform, loadout and a vehicle parked outside, as the Duty app says. Before, it only teleported you there

## [0.9.0-ptb.5] - 2026-10-14

### Added
Expand Down Expand Up @@ -148,8 +175,10 @@ The first public test build.
- Only Mission Row has armory, locker room and garage points
- Back up your database before updating between test builds

[Unreleased]: https://github.com/FivePRS/core/compare/v0.9.0-ptb.3...HEAD
[0.9.0-ptb.3]: https://github.com/FivePRS/core/compare/v0.9.0-ptb.3...v0.9.0-ptb.4
[Unreleased]: https://github.com/FivePRS/core/compare/v0.9.0-ptb.6...HEAD
[0.9.0-ptb.6]: https://github.com/FivePRS/core/compare/v0.9.0-ptb.5...v0.9.0-ptb.6
[0.9.0-ptb.5]: https://github.com/FivePRS/core/compare/v0.9.0-ptb.4...v0.9.0-ptb.5
[0.9.0-ptb.4]: https://github.com/FivePRS/core/compare/v0.9.0-ptb.3...v0.9.0-ptb.4
[0.9.0-ptb.3]: https://github.com/FivePRS/core/compare/v0.9.0-ptb.2...v0.9.0-ptb.3
[0.9.0-ptb.2]: https://github.com/FivePRS/core/compare/v0.9.0-ptb.1...v0.9.0-ptb.2
[0.9.0-ptb.1]: https://github.com/FivePRS/core/releases/tag/v0.9.0-ptb.1
8 changes: 5 additions & 3 deletions FivePRS.Client/Agency/DepartmentAgency.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ public override async Task OnDuty(PlayerData player)
_dispatcher.Start();

var mode = StationService.TakePendingStart(out var station);
var message = ShouldEquip(mode)
var message = mode == DutyStartMode.Current
? $"You're on duty as you are. Collect your {EquipmentNoun} at a station when you need them."
: ShouldEquip(mode)
? await EquipAsync(player, mode, station)
: await ReportToStationAsync(mode, station);

Expand Down Expand Up @@ -70,7 +72,7 @@ public override async Task OnCalloutReceived(CalloutData callout)
{
DutyEquipmentMode.Always => true,
DutyEquipmentMode.Station => false,
_ => mode == DutyStartMode.Here,
_ => mode == DutyStartMode.Here || mode == DutyStartMode.Teleport,
};

private async Task<string> EquipAsync(PlayerData player, DutyStartMode mode, StationDef? station)
Expand Down Expand Up @@ -163,7 +165,7 @@ private void OnCalloutEnded(CalloutBase callout, CalloutResult result)
if (result == CalloutResult.Completed)
Notify("~g~CALLOUT COMPLETE~w~");
else if (result == CalloutResult.Failed)
Notify("~r~CALLOUT FAILED~w~ | No XP awarded.");
Notify(ClientBrain.LocalPlayerData.UsesXp ? "~r~CALLOUT FAILED~w~ | No XP awarded." : "~r~CALLOUT FAILED");

Log.Debug($"Callout '{callout.Data.Name}' ended: {result}.");
}
Expand Down
6 changes: 4 additions & 2 deletions FivePRS.Client/App/AdminPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,15 @@ public static void Act(IDictionary<string, object> data) =>
return new
{
State = _state,
XpEnabled = ClientBrain.LocalPlayerData.UsesXp,
Framework = ClientBrain.LocalPlayerData.Framework,
Ranks = ConfigManager.Departments.ToDictionary(
d => d.ToString(),
d => ((int)d).ToString(),
d => Enumerable.Range(1, ConfigManager.RanksFor(d).Count).Select(rank => ConfigManager.RanksFor(d).NameFor(rank)).ToList()),
Departments = Enum.GetValues(typeof(Department))
.Cast<Department>()
.Where(d => d != Department.None)
.Select(d => new { Id = (int)d, Name = d.ToString() })
.Select(d => new { Id = (int)d, Name = ConfigManager.DisplayName(d) })
.ToList(),
};
}
Expand Down
18 changes: 17 additions & 1 deletion FivePRS.Client/App/AppClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public AppClient()
EventHandlers[EventNames.ClientLookupResult] += new Action<string>(OnLookupResult);
EventHandlers[EventNames.ClientLookupError] += new Action<string>(OnLookupError);
EventHandlers[EventNames.ClientReports] += new Action<string>(OnReports);
EventHandlers[EventNames.ClientSpeedClocks] += new Action<string>(OnSpeedClocks);
EventHandlers[EventNames.ClientEmergencyStatus] += new Action<string>(OnEmergencyStatus);
EventHandlers[EventNames.ClientEmergencyError] += new Action<string>(OnEmergencyError);
EventHandlers[EventNames.ClientAdminState] += new Action<string>(OnAdminState);
Expand Down Expand Up @@ -160,6 +161,21 @@ private void OnLookupResult(string json)
Refresh();
}

private void OnSpeedClocks(string json)
{
try
{
RecordsPanel.SetClocks(json);
}
catch (Exception ex)
{
Log.Error("Could not read speed clocks", ex);
return;
}

Refresh();
}

private void OnReports(string json)
{
try
Expand Down Expand Up @@ -383,7 +399,7 @@ private static object BuildState(string? requestedApp)
return new
{
Nameplate = ConfigManager.Settings.Branding.Nameplate,
Icons = ConfigManager.Settings.Branding.Departments,
Icons = ConfigManager.Icons(),
Terminal = TerminalPanel.BuildView(),
Apps = TerminalApps.BuildList(),
AppView = TerminalApps.BuildOpenView(),
Expand Down
2 changes: 1 addition & 1 deletion FivePRS.Client/App/CivilianPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public static object BuildView()
Genders = CivilianRules.Genders,
MaxNameLength = CivilianRules.MaxNameLength,
CurrentVehicle = vehicle,
Icons = ConfigManager.Settings.Branding.Departments,
Icons = ConfigManager.Icons(),
StateInfo = ConfigManager.Licenses.State,
Mugshot = _mugshot,
};
Expand Down
16 changes: 9 additions & 7 deletions FivePRS.Client/App/DispatchPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public static void RequestBackup(IDictionary<string, object> data)
return new
{
self.Callsign,
Agency = ConfigManager.Territories.FindAgency(self.Agency)?.Name ?? self.Department.ToString(),
Agency = ConfigManager.Territories.FindAgency(self.Agency)?.Name ?? ConfigManager.DisplayName(self.Department),
Status = self.Status.ToString(),
};
}
Expand Down Expand Up @@ -120,8 +120,10 @@ public static void RequestBackup(IDictionary<string, object> data)
self.ServerId,
self.Callsign,
self.Name,
Department = self.Department.ToString(),
Agency = map.FindAgency(self.Agency)?.Name ?? self.Department.ToString(),
Department = ConfigManager.DisplayName(self.Department),
DepartmentKey = ConfigManager.ConfigName(self.Department),
AgencyId = self.Agency,
Agency = map.FindAgency(self.Agency)?.Name ?? ConfigManager.DisplayName(self.Department),
Status = self.Status.ToString(),
self.CallId,
Territory = map.FindTerritory(self.Territory)?.Name,
Expand All @@ -132,7 +134,7 @@ public static void RequestBackup(IDictionary<string, object> data)
call.Id,
call.Name,
Code = (int)call.Priority,
Department = call.Department.ToString(),
Department = ConfigManager.DisplayName(call.Department),
Territory = map.FindTerritory(call.Territory)?.Name,
HasLocation = call.X != 0f || call.Y != 0f,
DistanceM = call.X != 0f || call.Y != 0f
Expand All @@ -155,13 +157,13 @@ public static void RequestBackup(IDictionary<string, object> data)
unit.ServerId,
unit.Callsign,
unit.Name,
Department = unit.Department.ToString(),
Agency = map.FindAgency(unit.Agency)?.Name ?? unit.Department.ToString(),
Department = ConfigManager.DisplayName(unit.Department),
Agency = map.FindAgency(unit.Agency)?.Name ?? ConfigManager.DisplayName(unit.Department),
Status = unit.Status.ToString(),
unit.CallId,
Territory = map.FindTerritory(unit.Territory)?.Name,
}),
icons = ConfigManager.Settings.Branding.Departments,
icons = ConfigManager.Icons(),
};
}
}
Expand Down
19 changes: 12 additions & 7 deletions FivePRS.Client/App/DutyPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,10 @@ public static void SetOnDuty(bool isOnDuty)
private static string? SetStart(IDictionary<string, object> data, Department department, string agencyId)
{
var rawMode = NuiData.GetString(data, "start");
if (!Enum.TryParse<DutyStartMode>(rawMode, true, out var mode) || mode == DutyStartMode.Here)
if (!Enum.TryParse<DutyStartMode>(rawMode, true, out var mode)) mode = DutyStartMode.Current;
if (mode == DutyStartMode.Current || mode == DutyStartMode.Here)
{
StationService.SetPendingStart(DutyStartMode.Here, null);
StationService.SetPendingStart(mode, null);
return null;
}

Expand Down Expand Up @@ -99,8 +100,9 @@ public static object BuildView()
.Select(d => new
{
Id = (int)d,
Name = d.ToString(),
Agencies = map.AgenciesFor(d).Select(a => new { a.Id, a.Name, a.CallsignPrefix }).ToList(),
Name = ConfigManager.DisplayName(d),
Key = ConfigManager.ConfigName(d),
Agencies = map.AgenciesFor(d).Select(a => new { a.Id, a.Name, a.CallsignPrefix, HasIcon = !string.IsNullOrWhiteSpace(a.Icon) }).ToList(),
Stations = ConfigManager.Stations.For(d, null)
.Select(s => new { s.Id, s.Name, s.Agencies, Distance = (int)StationService.DistanceTo(s) })
.OrderBy(s => s.Distance)
Expand All @@ -117,19 +119,22 @@ public static object BuildView()
RankCount = profile.Ladder().Count,
Stats = new { Calls = profile.CallsCompleted, profile.Arrests, Hours = profile.DutySeconds / 3600 },
profile.XP,
profile.UsesXp,
XpToNext = profile.Ladder().XpToNext(profile.Rank),
profile.IsOnDuty,
DepartmentId = (int)profile.Department,
Department = profile.Department.ToString(),
Department = ConfigManager.DisplayName(profile.Department),
DepartmentKey = ConfigManager.ConfigName(profile.Department),
AgencyId = profile.Agency,
profile.Callsign,
CallsignMaxLength = Callsign.MaxLength,
Icons = ConfigManager.Settings.Branding.Departments,
Icons = ConfigManager.Icons(),
Departments = departments,
Unit = unit is null ? null : new
{
unit.Callsign,
Agency = map.FindAgency(unit.Agency)?.Name ?? unit.Department.ToString(),
Agency = map.FindAgency(unit.Agency)?.Name ?? ConfigManager.DisplayName(unit.Department),
AgencyId = unit.Agency,
},
};
}
Expand Down
7 changes: 7 additions & 0 deletions FivePRS.Client/App/RecordsPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using FivePRS.Core.Config;
using FivePRS.Core.Events;
using FivePRS.Core.Models;
using FivePRS.Core.Police;
using Newtonsoft.Json;

namespace FivePRS.Client.App
Expand All @@ -22,6 +23,7 @@ internal static class RecordsPanel
private static string? _query;
private static LookupRecord? _record;
private static ReportsView? _reports;
private static List<SpeedClock>? _clocks;

public static int DraftCount => _reports?.Drafts.Count ?? 0;

Expand All @@ -42,6 +44,10 @@ public static void SetReports(string json)

public static void RequestReports() => ClientEvents.TriggerServer(EventNames.ServerReportsRequest);

public static void SetClocks(string json) => _clocks = JsonConvert.DeserializeObject<List<SpeedClock>>(json) ?? new List<SpeedClock>();

public static void RequestClocks() => ClientEvents.TriggerServer(EventNames.ServerSpeedClocksRequest);

public static void SaveReport(IDictionary<string, object> data)
{
if (NuiData.TryGetInt(data, "reportId", out var id))
Expand Down Expand Up @@ -194,6 +200,7 @@ public static void FlagVehicle(IDictionary<string, object> data)
{
Medical = !Police,
Reports = Police ? null : _reports,
Clocks = Police ? _clocks : null,
MaxNarrative = ReportRules.MaxNarrativeLength,
AutoFileMinutes = ReportRules.AutoFileMinutes,
Stop = Police ? StreetIdentity.CurrentStop?.Invoke() : null,
Expand Down
Loading
Loading