🔧Installation
Here we're going to guide you in the installation of origen_police.
First we want you to know that our script only supports the following versions of the two most used frameworks, in older versions it may be usable but we do not provide support since the development focuses on the following versions:
ensure oxmysql/icmysql
ensure qb-core
...(make sure to start the inventory before the script)
ensure pma-voice
ensure origen_policeNow you have to insert the SQL files into your database:
Put that items on shared of qb-core.
['instant_camera'] = {['name'] = 'instant_camera', ['label'] = 'Instant camera', ['weight'] = 0, ['type'] = 'item', ['image'] = 'polaroid.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'A simple camera designed to take photos at a crime scene'}, 
['photo'] = {['name'] = 'photo', ['label'] = 'Photo', ['weight'] = 0, ['type'] = 'item', ['image'] = 'photos.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'An image'},
['evidence_a'] = {["name"] = "evidence_a", ["label"] = "Evidence of bullet", ["weight"] = 0, ["type"] = "item", ["image"] = "evidence_a.png", ["unique"] = true, ["useable"] = false, ["shouldClose"] = false, ["combinable"] = nil, ["description"] = "Evidence obtained from a crime scene"}, 
['evidence_az'] = {["name"] = "evidence_az", ["label"] = "Evidence", ["weight"] = 0, ["type"] = "item", ["image"] = "evidence_az.png", ["unique"] = true, ["useable"] = false, ["shouldClose"] = false, ["combinable"] = nil, ["description"] = "Evidence obtained from a crime scene"}, 
['evidence_b'] = {["name"] = "evidence_b", ["label"] = "Vehicle evidence", ["weight"] = 0, ["type"] = "item", ["image"] = "evidence_b.png", ["unique"] = true, ["useable"] = false, ["shouldClose"] = false, ["combinable"] = nil, ["description"] = "Evidence obtained from a crime scene"}, 
['evidence_n'] = {["name"] = "evidence_n", ["label"] = "Impact evidence", ["weight"] = 0, ["type"] = "item", ["image"] = "evidence_n.png", ["unique"] = true, ["useable"] = false, ["shouldClose"] = false, ["combinable"] = nil, ["description"] = "Evidence obtained from a crime scene"}, 
['evidence_ne'] = {["name"] = "evidence_ne", ["label"] = "Footprint evidence", ["weight"] = 0, ["type"] = "item", ["image"] = "evidence_ne.png", ["unique"] = true, ["useable"] = false, ["shouldClose"] = false, ["combinable"] = nil, ["description"] = "Evidence obtained from a crime scene"}, 
['evidence_r'] = {["name"] = "evidence_r", ["label"] = "Blood evidence", ["weight"] = 0, ["type"] = "item", ["image"] = "evidence_r.png", ["unique"] = true, ["useable"] = false, ["shouldClose"] = false, ["combinable"] = nil, ["description"] = "Evidence obtained from a crime scene"}, 
['evidence_ro'] = {["name"] = "evidence_ro", ["label"] = "Evidence", ["weight"] = 0, ["type"] = "item", ["image"] = "evidence_ro.png", ["unique"] = true, ["useable"] = false, ["shouldClose"] = false, ["combinable"] = nil, ["description"] = "Evidence obtained from a crime scene"}, 
['evidence_v'] = {["name"] = "evidence_v", ["label"] = "Drug evidence", ["weight"] = 0, ["type"] = "item", ["image"] = "evidence_v.png", ["unique"] = true, ["useable"] = false, ["shouldClose"] = false, ["combinable"] = nil, ["description"] = "Evidence obtained from a crime scene"}, 
['report_evidence'] = {["name"] = "report_evidence", ["label"] = "Evidence report", ["weight"] = 0, ["type"] = "item", ["image"] = "report_evidence.png", ["unique"] = true, ["useable"] = true, ["shouldClose"] = false, ["combinable"] = nil, ["description"] = "Here there can be collected up to 4 pieces of evidence"}, 
['k9'] = {["name"] = "k9", ["label"] = "K9 whistle", ["weight"] = 0, ["type"] = "item", ["image"] = "whistle.png", ["unique"] = true, ["useable"] = true, ["shouldClose"] = false, ["combinable"] = nil, ["description"] = "Use the whistle to call the K9 unit"}, 
['lspd_badge'] = {["name"] = "lspd_badge", ["label"] = "Police badge", ["weight"] = 0, ["type"] = "item", ["image"] = "lspd_badge.png", ["unique"] = true, ["useable"] = true, ["shouldClose"] = false, ["combinable"] = nil, ["description"] = "Your identification as a police officer, includes your rank and badge number"}, 
['bcsd_badge'] = {["name"] = "bcsd_badge", ["label"] = "Sheriff badge", ["weight"] = 0, ["type"] = "item", ["image"] = "bcsd_badge.png", ["unique"] = true, ["useable"] = true, ["shouldClose"] = false, ["combinable"] = nil, ["description"] = "Your identification as a sheriff's agent, including your rank and badge number"}, 
['police_cad'] = {["name"] = "police_cad", ["label"] = "Police tablet", ["weight"] = 0, ["type"] = "item", ["image"] = "tablet.png", ["unique"] = true, ["useable"] = true, ["shouldClose"] = false, ["combinable"] = nil, ["description"] = "Your personal tablet with all the information of the San Andreas police"}, 
['megaphone'] = {["name"] = "megaphone", ["label"] = "Megaphone", ["weight"] = 0, ["type"] = "item", ["image"] = "megaphone.png", ["unique"] = true, ["useable"] = true, ["shouldClose"] = false, ["combinable"] = nil, ["description"] = "A megaphone to make your voice heard"},ensure oxmysql/icmysql
ensure es_extended
...(make sure to start the inventory before the script)
ensure pma-voice
ensure origen_policeNow you have to insert the SQL files into your database:
Place images from the origen_police/[assets]/inventory_images path into your inventory images directory.
Inventory modifications
If your inventory script don't appear here you don't have to modify anything inside it.
At the end of the file qb-inventory/server/main.lua
exports('GetStashItems', GetStashItems)
RegisterServerEvent('qb-inventory:server:SaveStashItems', function(stashId, items)
    MySQL.insert('INSERT INTO stashitems (stash, items) VALUES (@stash, @items) ON DUPLICATE KEY UPDATE items = @items', {
        ['@stash'] = stashId,
        ['@items'] = json.encode(items)
    })
    if Stashes[stashId] then
	Stashes[stashId].items = items
    end
end)This is only for servers using ox_inventory and QBCore, servers using ESX can ignore this.
Insert this in ox_inventory/data/items.lua 
['instant_camera'] = {
	label = "Instant Camera",
	weight = 200,
	server = {
		export = "origen_police.instant_camera"
	},
	consume = 0
},
['photo'] = {
	label = "Photo",
	weight = 200,
	server = {
		export = "origen_police.photo"
	},
	consume = 0
},
['report_evidence'] = {
	label = "Report Evidence",
	weight = 200,
	server = {
		export = "origen_police.report_evidence"
	},
	consume = 0
},
['k9'] = {
	label = "K9 Whistle",
	weight = 200,
	server = {
		export = "origen_police.k9"
	},
	consume = 0
},
['lspd_badge'] = {
	label = "LSPD Badge",
	weight = 200,
	server = {
		export = "origen_police.lspd_badge"
	},
	consume = 0
},
['bcsd_badge'] = {
	label = "BCSD Badge",
	weight = 200,
	server = {
		export = "origen_police.bcsd_badge"
	},
	consume = 0
},
['fib_badge'] = {
	label = "FIB Badge",
	weight = 200,
	server = {
		export = "origen_police.fib_badge"
	},
	consume = 0
},
['police_cad'] = { -- By default the item name is police_cad, but you can change in origen_police/config/commands.lua -> Config.Commands.OpenPoliceCad.item
	label = "Police tablet",
	weight = 200,
	server = {
		export = "origen_police.police_cad"
	},
	consume = 0
},At the end of the file core_inventory/client/main.lua
exports("GetCurrentWeaponData", function()
    return currentWeaponData
end)Clothing modifications
If your clothing script don't appear here you don't have to modify anything inside it.
At the end of the file qb-clothing/client/main.lua
exports("GetSkinData", function()
    return skinData
end)Ambulance modifications
If your ambulance script don't appear here you don't have to modify anything inside it.
At the end of the file esx_ambulancejob/client/job.lua
RegisterCommand('revivep', function()
    local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
    revivePlayer(closestPlayer)
end)
RegisterCommand('healp', function()
    local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
    ESX.TriggerServerCallback('esx_ambulancejob:getItemAmount', function(quantity)
        if quantity > 0 then
            local closestPlayerPed = GetPlayerPed(closestPlayer)
            local health = GetEntityHealth(closestPlayerPed)
            if health > 0 then
                local playerPed = PlayerPedId()
                isBusy = true
                ESX.ShowNotification(_U('heal_inprogress'))
                TaskStartScenarioInPlace(playerPed, 'CODE_HUMAN_MEDIC_TEND_TO_DEAD', 0, true)
                Wait(10000)
                ClearPedTasks(playerPed)
                TriggerServerEvent('esx_ambulancejob:removeItem', 'medikit')
                TriggerServerEvent('esx_ambulancejob:heal', GetPlayerServerId(closestPlayer), 'big')
                ESX.ShowNotification(_U('heal_complete', GetPlayerName(closestPlayer)))
                isBusy = false
            else
                ESX.ShowNotification(_U('player_not_conscious'))
            end
        else
            ESX.ShowNotification(_U('not_enough_medikit'))
        end
    end, 'medikit')
end)Setup CFG Permissions
Check that you have all these lines in your cfg, if you don't have any add them.
add_ace group.admin command allow
add_ace group.admin command.quit deny
add_ace resource.qb-core command allow
add_ace qbcore.god command allow
add_principal qbcore.god group.admin
add_principal qbcore.god qbcore.admin
add_principal qbcore.admin qbcore.modNow you will need to register your license as the qbcore.god group. To do this, you can use this example replacing your license.
add_principal identifier.license:8f1a3xxxxxxxxxxxxxxxx qbcore.god # Player NameTo check if you have correctly configured the permissions you should have the empty Config.Maps which is in config/markers.lua and the SETTINGS button should appear at the bottom right of the tablet.
Example of how the Config.Maps should be:
Config.Maps = { -- YOU CAN USE THIS OPTION OR THE IN GAME MENU INSIDE THE POLICE TABLET
    -- PLACE YOUR STATION NAME HERE, Example: "default-gta"
}If you have the config/markers.lua correctly, you should get this message on F8 when starting the script for the first time:
WARNING: NO ACTIVE MAPS, PLEASE ADD SOME IN THE SETTING TAB OF THE POLICE TABLE
Screenshot of the location of the settings tab, if it's not showed check this guide again or ask in our discord server.

You will need to check that the permission group your character has is one of those listed in config/permissions.lua. Example of the default ones:
Config.PermissionsGroups = {
    "mod", "admin", "superadmin", "god" -- list of groups that will have all permissions, like "mod", "admin", "superadmin", etc
}To check if you have a valid permission group you should have the empty Config.Maps which is in config/markers.lua and the SETTINGS button should appear at the bottom right of the tablet.
Example of how the Config.Maps should be:
Config.Maps = { -- YOU CAN USE THIS OPTION OR THE IN GAME MENU INSIDE THE POLICE TABLET
    -- PLACE YOUR STATION NAME HERE, Example: "default-gta"
}If you have the config/markers.lua correctly, you should get this message on F8 when starting the script for the first time:
WARNING: NO ACTIVE MAPS, PLEASE ADD SOME IN THE SETTING TAB OF THE POLICE TABLE
Screenshot of the location of the settings tab, if it's not showed check this guide again or ask in our discord server.

Important
Remember to follow the pma-voice installation steps here:
Pma-VoiceLast updated
