Inicio › Documentación › Instalación · origen_police

Instalación · origen_police

Nuestro script solo es compatible con las siguientes versiones de los dos frameworks más usados. En versiones anteriores puede funcionar, pero no damos soporte, ya que el desarrollo se centra en las siguientes versiones:

1. server.cfg

text
ensure oxmysql/icmysql
ensure qb-core
...(make sure to start the inventory before the script)
 
ensure pma-voice
ensure origen_police

2. SQL

Inserta los ficheros SQL en tu base de datos:

3. Objetos

Registra todos los objetos obligatorios en tu sistema de inventario. Consulta la lista completa con bloques para ox_inventory y QBCore:

Objetos →

Te recomendamos subir los ficheros del script sin usar FileZilla, ya que puede corromper nuestros scripts. Usa WinSCP u otro programa fiable.

Modificaciones del inventario

Si tu script de inventario no aparece aquí, no necesitas modificar nada en él.

qb-inventory

Al final de qb-inventory/server/main.lua:

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)

Modificaciones de la ropa

Si tu script de ropa no aparece aquí, no necesitas modificar nada en él.

qb-clothing

Al final de qb-clothing/client/main.lua:

lua
exports("GetSkinData", function()
    return skinData
end)

Modificaciones de la ambulancia

Si tu script de ambulancia no aparece aquí, no necesitas modificar nada en él.

esx_ambulancejob

Al final de esx_ambulancejob/client/job.lua:

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)

Configurar los permisos en el CFG

Asegúrate de tener todas estas líneas en tu server.cfg:

text
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.mod

Registra tu licencia en el grupo qbcore.god — sustitúyela por la tuya:

text
add_principal identifier.license:8f1a3xxxxxxxxxxxxxxxx qbcore.god # Player Name

Para verificar que los permisos están bien configurados, Config.Maps en config/markers.lua debería estar vacío y el botón SETTINGS debería aparecer abajo a la derecha de la tablet.

lua
Config.Maps = { -- YOU CAN USE THIS OPTION OR THE IN GAME MENU INSIDE THE POLICE TABLET
    -- PLACE YOUR STATION NAME HERE, Example: "default-gta"
}

Si está bien configurado, verás este mensaje en F8 en el primer arranque:

text
WARNING: NO ACTIVE MAPS, PLEASE ADD SOME IN THE SETTING TAB OF THE POLICE TABLE

Importante

Recuerda seguir los pasos de instalación de pma-voice:

Instalación de pma-voice →