Bodycam

The bodycam feature allows players to activate a bodycam that other officers can view in real-time.

Adding the bodycam item to your inventory

To add the bodycam item to your inventory, follow the steps for your specific inventory system:

ox_inventory (@ox_inventory/data/items.lua)

['bodycam'] = {
    label = 'Bodycam',
    weight = 300,
    stack = false,
    close = true,
    allowArmed = true,
    consume = 0,
    client = { event = 'redutzu-mdt:client:toggle-bodycam-state', image = 'bodycam.png' },
    description = 'Let other players see your body with the most advanced bodycam on FiveM'
}

qb-inventory (@qb-core/shared/items.lua)

bodycam = {
    name = 'bodycam',
    label = 'Bodycam',
    weight = 300,
    type = 'item',
    image = 'bodycam.png',
    unique = true,
    useable = true,
    shouldClose = true,
    combinable = nil,
    description = 'Let other players see your body with the most advanced bodycam on FiveM'
}

qs-inventory (@qs-inventory/shared/items.lua)

['bodycam'] = {
    ['name'] = 'bodycam',
    ['label'] = 'Bodycam',
    ['weight'] = 300,
    ['type'] = 'item',
    ['image'] = 'bodycam.png',
    ['unique'] = true,
    ['useable'] = true,
    ['shouldClose'] = true,
    ['combinable'] = nil,
    ['description'] = 'Let other players see your body with the most advanced bodycam on FiveM'
}

Modifying Bodycam Functionality

The functionality of the bodycam can be modified in the server/custom/bodycam/default.lua file. This file contains the default implementation of the bodycam feature, and you can customize it to fit your needs.

The image of the bodycam item is located in the same directory as the default.lua file.

Server-Side Export

There is also a server-side export to check if a player has the bodycam enabled:

exports['redutzu-mdt']:isBodycamEnabled(source)

To toggle the bodycam, the player must have the bodycam item in their inventory and use it. The UI will appear, indicating that the bodycam is enabled, and any officer can then view the player's real-time footage.

Last updated