This is a simple tutorial, on how to add placeable camera item.
To configs/cameras.lua
-> items
, add new option:
---@type table<string, CameraConfig>
items = {
-- ...
['cctv_example'] = {
model = 'prop_cctv_cam_06a',
groups = { 'police' },
isShared = { 'police', 'ambulance' }
}
},
Now you need to add items to your inventory.
Add items to ox_inventory/data/items.lua
;
["cctv_example"] = {
label = 'CCTV Camera',
weight = 200,
server = {
export = 'fd_dispatch.useCam'
}
},
You can use premade icons from options/inventory icons
folder.
Restart your server, and enjoy new camera item!
With script, we added two predefined items.
---@type table<string, CameraConfig>
items = {
['cctv_ceiling'] = {
model = 'prop_cctv_cam_06a',
groups = { 'police' },
isShared = { 'police', 'ambulance' }
},
['cctv_wall'] = {
model = 'prop_cctv_cam_01a',
}
},
Add these items to your inventory
Add items to ox_inventory/data/items.lua
;
['cctv_ceiling'] = {
label = 'CCTV Ceiling',
weight = 200,
server = {
export = 'fd_dispatch.useCam'
}
},
['cctv_wall'] = {
label = 'CCTV Wall',
weight = 200,
server = {
export = 'fd_dispatch.useCam'
}
},