This script is designed to work seamlessly with ESX and QBCore/QBOX frameworks.
The configuration is the same for all frameworks and requires no additional steps.
Install Dependencies
Resource
Download
ox_lib
Insert SQL (ONLY ESX)
You can use the insert.sql file included in the script or copy its contents and execute them to set it up in your database.
Go to ox_inventory > modules > utils > client.lua and locate the Utils.WeaponWheel function.
Underneath that function, add the following code:
-- Added
local Zombie = GetResourceState("bz_zombie") == "started" and exports["bz_zombie"]:inZombie() or false
if Zombie then
state = true
end
--All Function
function Utils.WeaponWheel(state)
if client.disableweapons then state = true end
if state == nil then state = EnableWeaponWheel end
local Zombie = GetResourceState("bz_zombie") == "started" and exports["bz_zombie"]:inZombie() or false
if Zombie then
state = true
end
EnableWeaponWheel = state
SetWeaponsNoAutoswap(not state)
SetWeaponsNoAutoreload(not state)
if client.suppresspickups then
-- CLEAR_PICKUP_REWARD_TYPE_SUPPRESSION | SUPPRESS_PICKUP_REWARD_TYPE
return state and N_0x762db2d380b48d04(rewardTypes) or N_0xf92099527db8e2a7(rewardTypes, true)
end
end
Revive Event
Config.Revive = function(ped)
if GetResourceState("qb-ambulancejob") == "started" then
TriggerEvent("hospital:client:Revive")
elseif GetResourceState("esx_ambulancejob") == "started" then
TriggerEvent("esx_ambulancejob:revive")
end
end
Inventory Image
Config.ItemImage = function(item)
if GetResourceState("ox_inventory") == "started" then
return "nui://ox_inventory/web/images/"..item..".png"
elseif GetResourceState("qb-inventory") == "started" then
return "nui://qb-inventory/html/images/"..item..".png"
elseif GetResourceState("bb_inventory") == "started" then
return "nui://bb_inventory/html/images/"..item..".png"
end
end
Logs (server/logs.lua)
Webhooks = {
["addcoin"] = "",
["buyproduct"] = "",
}
function Logger(name, title, message)
if not Webhooks[name] then return end
local webHook = Webhooks[name] ~= '' and Webhooks[name] or false
if not webHook then return end
local embedData = {
{
['title'] = title,
['color'] = 65280,
['footer'] = {
['text'] = os.date('%c'),
},
['description'] = message,
['author'] = {
['name'] = GetCurrentResourceName(),
['icon_url'] = 'https://i.imgur.com/fitctCs.png',
}
}
}
logsData = { username = 'BZ Logs', embeds = embedData }
PerformHttpRequest(webHook, function() end, 'POST', json.encode(logsData), { ['Content-Type'] = 'application/json' })
end