🛠️Setup

This is a detailed setup guide for Bodycam & Dashcam. If you have any questions before making a purchase, you can contact us on Discord

Installation

  1. Download & Extract: Place the script in your resources folder.

  2. Add to Server CFG: Add ensure cs_bodycamto your server.cfg.

  3. Configure Settings: Modify config.lua as needed.

  4. Add Inventory Items (Only QB & ESX):

    • Ox Inventory: Add the following to ox_inventory/data/items.lua:

      ['bodycam'] = {
          label = 'Radio',
          weight = 500,
          stack = false,
          description = 'A portable body camera used by law enforcement.'
          client = {
              event = 'cs:bodycam:useBodyCam',
              remove = function(total)
                  if total < 1 then
                      TriggerEvent('cs:bodycam:forceStop')
                  end
              end
          }
      }
      ['dashcam'] = {
          label = 'Dash Cam',
          weight = 500,
          stack = false,
          description = 'A vehicle-mounted dashcam used for recording footage.'
          client = {
              event = 'cs:bodycam:useDashCam',
          }
      },
    • QB Inventory: Add the following to qb-core/shared/items.lua:

      ["bodycam"] = {
          name = "bodycam",
          label = "Body Cam",
          weight = 500,
          type = "item",
          image = "bodycam.png",
          unique = true,
          description = "A portable body camera used by law enforcement."
      },
      
      ["dashcam"] = {
          name = "dashcam",
          label = "Dash Cam",
          weight = 500,
          type = "item",
          image = "dashcam.png",
          unique = true,
          description = "A vehicle-mounted dashcam used for recording footage."
      },
    • ESX Inventory: Run the following SQL query in your database:

      INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES
      ('bodycam', 'Body Cam', 1, 0, 1),
      ('dashcam', 'Dash Cam', 1, 0, 1);

Configuration

Modify the config.lua file to customize the script:

General Framework Settings

Dashboard Panel & Groups

Using Standalone Mode

If you are running a standalone server (not using QBCore or ESX), you need to define user permissions manually using Steam, Ace Permissions, Discord IDs, or Role IDs. Here’s how to configure it:

  • DashBoard_Access: Replace 'put_perms_here' with Steam HEX, Ace Group, Discord ID, or Role ID.

  • Title: Department name.

  • Logo: Path to department logo.

  • Location: If set, players must stand at this position to access the dashboard. Set to false if not required.

BodyCam Settings

DashCam Settings

Recording Settings

  • Enable: Turns the recording feature on or off.

  • Fivemanage: If using FiveManage API, set this to true.

  • Fivemerr: If using FiveMerr API, set this to true.

  • RecordFPS: Determines the frame rate of the recorded video.

  • RecordMic: If true, records microphone audio with the video.

  • RecordMicKey : Push-to-Talk key to record audio while recording.

  • Max_Recording_Time: The maximum duration (in seconds) for a single recording clip.

Note: The recording API or discord webhook settings can be configured in sv_function.lua

Use FiveManage or FiveMerr for longer video sizes due to the Discord webhook limit

Enabling Automatic Recording When Using BodyCam (Item)

Modify and replace existing code incs_bodycam\config\functions\sv_function.lua at line 90 with the below code to automatically start recording when a bodycam is used:

This ensures the recording automatically starts when a player uses the bodycam item.

Adding a Keybind for Recording

To allow players to start recording by pressing Y (configurable), add the following code to cs_bodycam\config\functions\cl_function.lua:

This binds the Y key to toggle recording, providing a convenient way for players to start and stop recording manually.

How to Use

  1. Access Dashboard: Stand at the designated location (if set) and open the panel.

  2. Use BodyCam: Run /bodycam (if enabled) or activate via inventory.

  3. Use DashCam: Run /dashcam in a valid vehicle.

  4. Use Recording: Run /recording to open the record panel.

Last updated