L2S Documentation
DiscordTebex
  • Documentation
  • Information
    • Discord Roles
    • How to update your asset
    • FiveM Asset Escrow System
  • Coding Information
    • Webhook System
    • Register Key Mapping
    • Translation System
  • ASSETS & GUIDES
    • 🚨Dispatch
      • ⤵️Installation
      • ⚙️Configuration
        • Settings
        • API
        • Hub
        • CCTV
        • Dispatch
        • UI
      • 💻Integration
        • Exports
          • Client
          • Server
        • Police Alerts
        • Radio Channel
        • Duty System
    • 🏨Hotels V2
      • ⤵️Installation
      • ⚙️Configuration
        • Config
        • Elevators
        • Hotels
      • 💻Exports
    • 👮Police Hub
      • ⤵️Installation
      • ⚙️Configuration
      • 💻Events & Alerts
    • 💀Gangs Turf
      • ⤵️Installation
      • ⚙️Configuration
        • Settings
        • Gangs
      • 💻Exports
      • 📚Tutorial
    • 🔫Paint Ball
      • ⤵️Installation
      • ⚙️Configuration
        • Settings
        • Clothes
        • Locations
      • 💻Exports
Powered by GitBook
On this page
  • # STEP 1 - Check dependencies
  • # STEP 2 - Drag And Drop
  • # STEP 3 - Setup Items and Images
  • # STEP 4 - Set Up metadata
  • # STEP 5- Dependencies for inventory
  • # STEP 6 - Start The Script
  1. ASSETS & GUIDES
  2. Police Hub

Installation

PreviousPolice HubNextConfiguration

Last updated 4 months ago

# STEP 1 - Check dependencies

Make sure you have installed all .

# STEP 2 - Drag And Drop

Drag and drop the l2s-policehub to your resources folder.

# STEP 3 - Setup Items and Images

Set Up Items According to your inventory

1- Add Items in qb-core/shared/items.lua

["bodycam"] = {
	["name"] = "bodycam",
	["label"] = "Bodycam",
	["weight"] = 500, 
	["type"] = "item", 
	["image"] = "bodycam.png", 	
	["unique"] = true, 
	["useable"] = false, 
	["shouldClose"] = true,	 
	["combinable"] = nil, 
	["description"] = "Body Camera for police"
},

2- Add Image in qb-inventory/html/images/...

# STEP 4 - Set Up metadata

Go to qb-core/server/player.lua and add this metadata

If you have the old method of metadata (your metadata in player.lua instead of config.lua) put it inside this path:

qb-core/server/player.lua

PlayerData.metadata['policehub'] = PlayerData.metadata['policehub'] or {
        ['alerts'] = {
            ['enablealerts'] = true,
            ['autoclear'] = false,
            ['mute'] = false,
        },
        ['wings'] = {
            [1] = false,
            [2] = false,
            [3] = false,
            [4] = false,
            [5] = false,
            [6] = false,
            [7] = false,
            [8] = false,
            [9] = false,
        },
        ['direction'] = nil,
        ['Assignment'] = nil,
        ['OfficerPlayTime'] = 0,
    }
    PlayerData.metadata["dutybusy"] = PlayerData.metadata["dutybusy"] ~= nil and PlayerData.metadata["dutybusy"] or false
    PlayerData.metadata["dutybreak"] = PlayerData.metadata["dutybreak"] ~= nil and PlayerData.metadata["dutybreak"] or false

If you have the last version of qb-core and (your metadata in config.lua) copy paste the code in this path:

qb-core/config.lua

        policehub = {
            ['alerts'] = {
                ['enablealerts'] = true,
                ['autoclear'] = false,
                ['mute'] = false,
            },
            ['wings'] = {
                [1] = false,
                [2] = false,
                [3] = false,
                [4] = false,
                [5] = false,
                [6] = false,
                [7] = false,
                [8] = false,
                [9] = false,
            },
            ['direction'] = nil,
            ['Assignment'] = nil,
            ['OfficerPlayTime'] = 0,
        },
        

If you use QBox Framework copy paste the code in this path:

qbx-core/server/player.lua

    playerData.metadata['policehub'] = playerData.metadata['policehub'] or {
        ['alerts'] = {
            ['enablealerts'] = true,
            ['autoclear'] = false,
            ['mute'] = false,
        },
        ['wings'] = {
            [1] = false,
            [2] = false,
            [3] = false,
            [4] = false,
            [5] = false,
            [6] = false,
            [7] = false,
            [8] = false,
            [9] = false,
        },
        ['direction'] = nil,
        ['Assignment'] = nil,
        ['OfficerPlayTime'] = 0,
    }
    playerData.metadata["dutybusy"] = playerData.metadata["dutybusy"] ~= nil and playerData.metadata["dutybusy"] or false
    playerData.metadata["dutybreak"] = playerData.metadata["dutybreak"] ~= nil and playerData.metadata["dutybreak"] or false

# STEP 5- Dependencies for inventory

To use bodycam system you must add some function in your inventory script

1-Add This In AddItem Function : in qb-inventory or your inventory script

if item == 'bodycam' then
	TriggerClientEvent('l2s-policehub:client:togglebody', source)
end

2- Add This In RemoveItem Function : in qb-inventory or your inventory script

if item == 'bodycam' then
	TriggerClientEvent('l2s-policeuhub:client:cancelbody', -1, Player.PlayerData.source)
end

# STEP 6 - Start The Script

1 - Start the script on your server.cfg

ensure l2s-policehub
👮
⤵️
dependencies
10KB
Item Image (bodycam).rar