Merge branch 'dev' of https://github.com/The-Order-Of-The-Sacred-Framework/community_bridge into dev
This commit is contained in:
commit
b53299e05e
7 files changed
+27
-36
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
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
if GetResourceState('ox_lib') ~= 'started' or (BridgeClientConfig.InputSystem ~= "ox" and BridgeClientConfig.InputSystem ~= "auto") then return end
|
||||
|
||||
|
||||
|
||||
function QBTypeToOxType(_type)
|
||||
if _type == "text" then
|
||||
return "input"
|
||||
@@ -18,7 +16,6 @@ function QBTypeToOxType(_type)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function QBToOxInput(data)
|
||||
local returnData = {}
|
||||
for i, v in pairs(data) do
|
||||
@@ -44,7 +41,6 @@ function QBToOxInput(data)
|
||||
return returnData
|
||||
end
|
||||
|
||||
|
||||
function OpenInput(title, data, isQBFormat, submitText)
|
||||
local inputs = data.inputs
|
||||
if isQBFormat then
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
|
||||
if GetResourceState('qb-input') ~= 'started' or (BridgeClientConfig.InputSystem ~= "qb" and BridgeClientConfig.InputSystem ~= "auto") then return end
|
||||
|
||||
|
||||
-- ox to Qb
|
||||
function OxTypeToQBType(_type)
|
||||
if _type == "input" then
|
||||
return "text"
|
||||
@@ -65,5 +63,5 @@ function OpenInput(title, data, isQBFormat, submitText)
|
||||
header = title,
|
||||
submitText = submitText or "Submit",
|
||||
inputs = input
|
||||
})
|
||||
})
|
||||
end
|
||||
@@ -78,14 +78,7 @@ if GetResourceState('ox_lib') ~= 'started' and GetResourceState('qb-menu') ~= 's
|
||||
-- "input", "number", "checkbox", "select", "multi-select", "slider", "color", "date", "date-range", "time", "textarea",
|
||||
Input = {}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-- qb to ox
|
||||
|
||||
--Open menu
|
||||
|
||||
function Input.Open(title, data, isQBFormat, submitText)
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
RegisterNetEvent("community_bridge:server:alert", function(data)
|
||||
local playersByJob = Framework.GetPlayersByJob(data.job)
|
||||
for _, src in pairs(playersByJob) do
|
||||
TriggerClientEvent("community_bridge:client:alert", src, data)
|
||||
end
|
||||
end)
|
||||
Reference in new issue
Block a user