Policing Redefined

website·Indexed 29 days ago

https://policing-redefined.netlify.app

An LSPDFR plugin and developer framework featuring the Common Data Framework (CDF). It provides APIs for traffic control, vehicle and ped data management, backup systems, and dispatch interactions for developers creating immersion plugins.

Tokens
17.4K
Snippets
127
Records
150
Agent score
74%

What's inside Policing Redefined

  1. Overview of Common Data Framework (CDF) for LSPDFR

    The Common Data Framework (CDF) is an open-source LSPDFR plugin designed to extend the vehicle and pedestrian record API for developers. It fills gaps in the standard LSPDFR API and ensures that entity data is synchronized across all plugins utilizing the framework. CDF is used by PolicingRedefined and is intended for integration into other plugins such as GrammarPolice, ReportsPlus, and ExternalPoliceComputer.
  2. Overview of Policing Redefined Developer Tools

    Policing Redefined is an LSPDFR plugin designed to provide a feature-rich API for creating immersive mods. It focuses on providing consistent data management for peds and vehicles across different plugins through the CommonDataFramework (CDF), an open-source library used to store, retrieve, and edit entity information. The Policing Redefined API specifically provides functionality for managing search items, ped impairment, ped mindset (resistance/mood), and requesting dispatch.
  3. Overview of Policing Redefined for LSPDFR

    Policing Redefined (PR) is a plugin for LSPDFR designed to provide a more immersive patrol experience. It expands upon the functionality of traditional plugins (such as Stop The Ped, Ultimate Backup, LSPDFR+, and Arrest-Manager) by advancing ped and traffic stops and introducing additional vehicle and on-foot traffic stop mechanics.
  4. Overview of the Patrol Backup API

    The Patrol Backup API is a wrapper for the BackupAPI designed for immersion plugins. It allows developers to trigger backup requests without needing complex parameters. Note that using this API will automatically play dispatch audio and display notifications to the player. For general development, the Direct API is recommended over this wrapper.
  5. Use PedAddress to manage ped locations

    The PedAddress class encapsulates an address associated with a ped, including the postal code, street name, and world position. It provides several ways to initialize an address: randomly, via a specific postal code and street, or based on a world position.
    // Random address
    PedAddress randomAddr = new PedAddress();
    
    // Specific postal and street
    PedAddress specificAddr = new PedAddress(postalObj, "Main St");
    
    // Based on world position
    PedAddress posAddr = new PedAddress(new Vector3(100f, 200f, 30f));
  6. Access VehicleBOLO metadata properties

    The VehicleBOLO class provides several read-only properties to retrieve details about the BOLO entry:
    public readonly string Reason;    // The descriptive reason for the BOLO
    public readonly DateTime Issued;  // Date and time officially issued
    public readonly DateTime Expires; // Date and time set to expire
    public readonly string IssuedBy;   // Agency or entity that issued the BOLO
  7. Install Policing Redefined (PR) plugin

    To install Policing Redefined, extract the Policing Redefined v[VERSION].zip archive and drag-and-drop the contents of the GTAV MAIN DIRECTORY folder into your GTA 5 root directory. After installation, you should see files and folders related to PolicingRedefined and CommonDataFramework within your plugins/LSPDFR directory.
  8. Install Policing Redefined for development

    To set up Policing Redefined for development, first install the latest versions of LSPDFR and RagePluginHook. Download the Policing Redefined package, extract the .zip file, and move all contents (excluding the .xml file) into the main GTA 5 directory. To use the library in a project, reference PolicingRedefined.dll in your assembly.
  9. Manage vehicle ownership and owner types

    The VehicleData class allows managing vehicle ownership via TrySetOwner overloads. Setting an owner manually sets the OwnerType to EVehicleOwnerType.Manual. When accessing the Owner property (which returns PedData), always check Owner.HasRealPed before accessing Owner.Holder, as the owner may be a government entity or a random ped without a corresponding in-game Rage.Ped instance.
    // Set owner by type (e.g., Driver, Government)
    public bool TrySetOwner(EVehicleOwnerType ownerType);
    
    // Set owner to a specific PedData record
    public bool TrySetOwner(PedData pedData);
  10. Access and manage pedestrian and vehicle data using CDF

    CDF provides a lightweight API to retrieve extended data for entities. Data is persisted in a database for a period after an entity ceases to exist to ensure accessibility. End-users can customize data probabilities via a .ini file without requiring additional code from the developer.
    // Retrieve pedestrian data
    var pedData = ped.GetPedData();
    
    // Retrieve vehicle data
    var vehicleData = vehicle.GetVehicleData();
  11. Example complete loadout configuration

    This example demonstrates a full Settings/Loadouts.xml setup including a mix of vehicle-bound weapons (stored in doors and trunk) and immediate inventory weapons (like a pistol and nightstick).
    <AllLoadouts>
        <Loadout LoadoutName="Default Loadout" IsDefaultLoadout="true">
            <LoadoutWeapons>
                <LoadoutWeapon WeaponHash="WEAPON_PUMPSHOTGUN" StartingAmmoCount="20" IsVehicleWeapon="true"
                               WeaponLocation="FrontDoors" WeaponDisplayName="Pump Shotgun">
                    <WeaponComponents>
                        <WeaponComponent ComponentHash="COMPONENT_AT_AR_FLSH"/>
                    </WeaponComponents>
                </LoadoutWeapon>
    
                <LoadoutWeapon WeaponHash="WEAPON_CARBINERIFLE" StartingAmmoCount="60" IsVehicleWeapon="true"
                               UseRackingAnimation="true" WeaponLocation="FrontDoors" WeaponDisplayName="Carbine Rifle">
                    <WeaponComponents>
                        <WeaponComponent ComponentHash="COMPONENT_AT_AR_FLSH"/>
                        <WeaponComponent ComponentHash="COMPONENT_AT_AR_AFGRIP"/>
                    </WeaponComponents>
                </LoadoutWeapon>
    
                <LoadoutWeapon WeaponHash="WEAPON_GRENADELAUNCHER_SMOKE" StartingAmmoCount="20" IsVehicleWeapon="true"
                               WeaponLocation="Trunk" WeaponDisplayName="Smoke Launcher">
                    <WeaponComponents>
                        <WeaponComponent ComponentHash="COMPONENT_AT_AR_FLSH"/>
                    </WeaponComponents>
                </LoadoutWeapon>
    
                <LoadoutWeapon WeaponHash="WEAPON_PISTOL" StartingAmmoCount="90">
                    <WeaponComponents>
                        <WeaponComponent ComponentHash="COMPONENT_AT_PI_FLSH"/>
                    </WeaponComponents>
                </LoadoutWeapon>
    
                <LoadoutWeapon WeaponHash="WEAPON_STUNGUN">
                    <WeaponComponents>
                    </WeaponComponents>
                </LoadoutWeapon>
    
                <LoadoutWeapon WeaponHash="WEAPON_NIGHTSTICK">
                    <WeaponComponents>
                    </WeaponComponents>
                </LoadoutWeapon>
            </LoadoutWeapons>
        </Loadout>
    </AllLoadouts>