re-add requestanimdict, add notify/showhelp to the frameworks that offer it
qbx uses ox's so no point
This commit is contained in:
1 parent
0e28c3f1e4
commit
2fa129dddd
3 files changed
+26
-16
No files matched your search
+10
-16
@@ -92,6 +92,16 @@ Utility.LoadModel = function(model)
|
||||
return HasModelLoaded(model)
|
||||
end
|
||||
|
||||
Utility.RequestAnimDict = function(dict)
|
||||
RequestAnimDict(dict)
|
||||
local count = 0
|
||||
while not HasAnimDictLoaded(dict) and count < 30000 do
|
||||
Wait(0)
|
||||
count = count + 1
|
||||
end
|
||||
return HasAnimDictLoaded(dict)
|
||||
end
|
||||
|
||||
Utility.RemovePed = function(entity)
|
||||
local success = false
|
||||
DeleteEntity(entity)
|
||||
@@ -137,15 +147,6 @@ Utility.SetEntitySkinData = function(entity, skinData)
|
||||
return true
|
||||
end
|
||||
|
||||
Utility.NativeAlert = function(data)
|
||||
local message = data.message or 'No message provided'
|
||||
local coords = data.coords or GetEntityCoords(cache.ped)
|
||||
local job = data.job
|
||||
local scale = data.scale or 0.8
|
||||
local sprite = data.sprite or 1
|
||||
TriggerServerEvent('community_bridge:server:alert', {message = message, coords = coords, job = job, scale = scale, sprite = sprite})
|
||||
end
|
||||
|
||||
Utility.ReloadSkin = function()
|
||||
local skinData = Utility.GetEntitySkinData(cache.ped)
|
||||
Utility.SetEntitySkinData(cache.ped, skinData)
|
||||
@@ -279,13 +280,6 @@ AddEventHandler('onResourceStop', function(resource)
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterNetEvent('community_bridge:client:alert', function(data)
|
||||
local blip = Utility.CreateBlip(data.coords, data.sprite, 3, data.scale, data.message, true)
|
||||
SetTimeout(40000, function()
|
||||
Utility.RemoveBlip(blip)
|
||||
end)
|
||||
end)
|
||||
|
||||
exports('Utility', Utility)
|
||||
|
||||
return Utility
|
||||
@@ -16,6 +16,10 @@ Framework.GetPlayerMetaData = function(metadata)
|
||||
return ESX.GetPlayerData().metadata[metadata]
|
||||
end
|
||||
|
||||
Framework.Notify = function(message, type, time)
|
||||
return ESX.ShowNotification(message, type, time)
|
||||
end
|
||||
|
||||
Framework.GetPlayerIdentifier = function()
|
||||
return ESX.GetPlayerData().identifier
|
||||
end
|
||||
|
||||
@@ -17,6 +17,18 @@ Framework.GetPlayerMetaData = function(metadata)
|
||||
return QBCore.Functions.GetPlayerData().metadata[metadata]
|
||||
end
|
||||
|
||||
Framework.Notify = function(message, type, time)
|
||||
TriggerEvent('QBCore:Notify', message, 'primary', time)
|
||||
end
|
||||
|
||||
Framework.ShowHelpText = function(message, _position)
|
||||
return exports['qb-core']:DrawText(message, _position)
|
||||
end
|
||||
|
||||
Framework.HideHelpText = function()
|
||||
return exports['qb-core']:HideText()
|
||||
end
|
||||
|
||||
Framework.GetItemInfo = function(item)
|
||||
local itemData = QBCore.Shared.Items[item]
|
||||
if not itemData then return {} end
|
||||
|
||||
Reference in new issue
Block a user