Inicio › Documentación › 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:
ensure oxmysql/icmysql
ensure qb-core
...(make sure to start the inventory before the script)
ensure pma-voice
ensure origen_policeInserta los ficheros SQL en tu base de datos:
Registra todos los objetos obligatorios en tu sistema de inventario. Consulta la lista completa con bloques para ox_inventory y QBCore:
Te recomendamos subir los ficheros del script sin usar FileZilla, ya que puede corromper nuestros scripts. Usa WinSCP u otro programa fiable.
Si tu script de inventario no aparece aquí, no necesitas modificar nada en él.
Al final de 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)Si tu script de ropa no aparece aquí, no necesitas modificar nada en él.
Al final de qb-clothing/client/main.lua:
exports("GetSkinData", function()
return skinData
end)Si tu script de ambulancia no aparece aquí, no necesitas modificar nada en él.
Al final de 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)Asegúrate de tener todas estas líneas en tu server.cfg:
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.modRegistra tu licencia en el grupo qbcore.god — sustitúyela por la tuya:
add_principal identifier.license:8f1a3xxxxxxxxxxxxxxxx qbcore.god # Player NamePara 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.
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:
WARNING: NO ACTIVE MAPS, PLEASE ADD SOME IN THE SETTING TAB OF THE POLICE TABLERecuerda seguir los pasos de instalación de pma-voice: