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)
|
return HasModelLoaded(model)
|
||||||
end
|
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)
|
Utility.RemovePed = function(entity)
|
||||||
local success = false
|
local success = false
|
||||||
DeleteEntity(entity)
|
DeleteEntity(entity)
|
||||||
@@ -137,15 +147,6 @@ Utility.SetEntitySkinData = function(entity, skinData)
|
|||||||
return true
|
return true
|
||||||
end
|
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()
|
Utility.ReloadSkin = function()
|
||||||
local skinData = Utility.GetEntitySkinData(cache.ped)
|
local skinData = Utility.GetEntitySkinData(cache.ped)
|
||||||
Utility.SetEntitySkinData(cache.ped, skinData)
|
Utility.SetEntitySkinData(cache.ped, skinData)
|
||||||
@@ -279,13 +280,6 @@ AddEventHandler('onResourceStop', function(resource)
|
|||||||
end
|
end
|
||||||
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)
|
exports('Utility', Utility)
|
||||||
|
|
||||||
return Utility
|
return Utility
|
||||||
@@ -16,6 +16,10 @@ Framework.GetPlayerMetaData = function(metadata)
|
|||||||
return ESX.GetPlayerData().metadata[metadata]
|
return ESX.GetPlayerData().metadata[metadata]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Framework.Notify = function(message, type, time)
|
||||||
|
return ESX.ShowNotification(message, type, time)
|
||||||
|
end
|
||||||
|
|
||||||
Framework.GetPlayerIdentifier = function()
|
Framework.GetPlayerIdentifier = function()
|
||||||
return ESX.GetPlayerData().identifier
|
return ESX.GetPlayerData().identifier
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -17,6 +17,18 @@ Framework.GetPlayerMetaData = function(metadata)
|
|||||||
return QBCore.Functions.GetPlayerData().metadata[metadata]
|
return QBCore.Functions.GetPlayerData().metadata[metadata]
|
||||||
end
|
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)
|
Framework.GetItemInfo = function(item)
|
||||||
local itemData = QBCore.Shared.Items[item]
|
local itemData = QBCore.Shared.Items[item]
|
||||||
if not itemData then return {} end
|
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
|
if GetResourceState('ox_lib') ~= 'started' or (BridgeClientConfig.InputSystem ~= "ox" and BridgeClientConfig.InputSystem ~= "auto") then return end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function QBTypeToOxType(_type)
|
function QBTypeToOxType(_type)
|
||||||
if _type == "text" then
|
if _type == "text" then
|
||||||
return "input"
|
return "input"
|
||||||
@@ -18,7 +16,6 @@ function QBTypeToOxType(_type)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function QBToOxInput(data)
|
function QBToOxInput(data)
|
||||||
local returnData = {}
|
local returnData = {}
|
||||||
for i, v in pairs(data) do
|
for i, v in pairs(data) do
|
||||||
@@ -44,7 +41,6 @@ function QBToOxInput(data)
|
|||||||
return returnData
|
return returnData
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function OpenInput(title, data, isQBFormat, submitText)
|
function OpenInput(title, data, isQBFormat, submitText)
|
||||||
local inputs = data.inputs
|
local inputs = data.inputs
|
||||||
if isQBFormat then
|
if isQBFormat then
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
|
|
||||||
if GetResourceState('qb-input') ~= 'started' or (BridgeClientConfig.InputSystem ~= "qb" and BridgeClientConfig.InputSystem ~= "auto") then return end
|
if GetResourceState('qb-input') ~= 'started' or (BridgeClientConfig.InputSystem ~= "qb" and BridgeClientConfig.InputSystem ~= "auto") then return end
|
||||||
|
|
||||||
|
|
||||||
-- ox to Qb
|
|
||||||
function OxTypeToQBType(_type)
|
function OxTypeToQBType(_type)
|
||||||
if _type == "input" then
|
if _type == "input" then
|
||||||
return "text"
|
return "text"
|
||||||
@@ -65,5 +63,5 @@ function OpenInput(title, data, isQBFormat, submitText)
|
|||||||
header = title,
|
header = title,
|
||||||
submitText = submitText or "Submit",
|
submitText = submitText or "Submit",
|
||||||
inputs = input
|
inputs = input
|
||||||
})
|
})
|
||||||
end
|
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", "number", "checkbox", "select", "multi-select", "slider", "color", "date", "date-range", "time", "textarea",
|
||||||
Input = {}
|
Input = {}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- qb to ox
|
-- qb to ox
|
||||||
|
|
||||||
--Open menu
|
--Open menu
|
||||||
|
|
||||||
function Input.Open(title, data, isQBFormat, submitText)
|
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