Skip to content

Commit 4c13dd9

Browse files
committed
fix to few issues with ox_inventory
1 parent 495b32c commit 4c13dd9

File tree

8 files changed

+15
-5
lines changed

8 files changed

+15
-5
lines changed

client/bridge/esx.lua

+2
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,14 @@ if Shared.Core == "esx" then
3535
RegisterNetEvent('esx:playerLoaded', function(xPlayer)
3636
ESX.PlayerData = xPlayer
3737
ESX.PlayerLoaded = true
38+
Radio.playerLoaded = true
3839
Radio:ESXInit()
3940
end)
4041

4142
RegisterNetEvent('esx:onPlayerLogout', function()
4243
Radio.PlayerItems = {}
4344
Radio.hasRadio = false
45+
Radio.playerLoaded = false
4446
Radio:leaveradio()
4547
end)
4648

client/bridge/ox.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ if Shared.Inventory == "ox" then
44
Radio:ESXInit()
55
elseif Shared.Core == "qb" then
66
Radio:QBInit()
7-
elseif Shared.Core == "qbox" then
7+
elseif Shared.Core == "qbx" then
88
Radio:QboxInit()
99
end
1010
end)

client/bridge/qb.lua

+2
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,15 @@ if Shared.Core == "qb" then
2727

2828
RegisterNetEvent('QBCore:Client:OnPlayerLoaded', function()
2929
Radio:QBInit()
30+
Radio.playerLoaded = true
3031
end)
3132

3233
-- Resets state on logout, in case of character change.
3334
RegisterNetEvent('QBCore:Client:OnPlayerUnload', function()
3435
Radio.PlayerItems = {}
3536
Radio.hasRadio = false
3637
Radio:leaveradio()
38+
Radio.playerLoaded = false
3739
end)
3840

3941
RegisterNetEvent('QBCore:Player:SetPlayerData', function(val)

client/bridge/qbox.lua

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
if Shared.Core == "qbox" then
1+
if Shared.Core == "qbx" then
22
function Radio:QboxInit(data)
33
local PlayerData = data or exports.qbx_core:GetPlayer()
44
if PlayerData then
@@ -26,13 +26,15 @@ if Shared.Core == "qbox" then
2626

2727
RegisterNetEvent('QBCore:Server:OnPlayerLoaded', function()
2828
Radio:QboxInit()
29+
Radio.playerLoaded = true
2930
end)
3031

3132
-- Resets state on logout, in case of character change.
3233
RegisterNetEvent('QBCore:Client:OnPlayerUnload', function()
3334
Radio.PlayerItems = {}
3435
Radio.hasRadio = false
3536
Radio:leaveradio()
37+
Radio.playerLoaded = false
3638
end)
3739

3840
RegisterNetEvent('QBCore:Client:OnJobUpdate', function(job)

client/event.lua

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@ AddEventHandler('onResourceStart', function(resource)
99
if GetCurrentResourceName() == resource then
1010
if Shared.Core == 'qb' and LocalPlayer.state.isLoggedIn then
1111
Radio:QBInit()
12-
elseif Shared.Core == 'qbx' and LocalPlayer.state.isLoggedIn then
12+
Radio.playerLoaded = true
13+
elseif Shared.Core == 'qbx' and LocalPlayer.state.isLoggedIn then
1314
Radio:QboxInit()
15+
Radio.playerLoaded = true
1416
elseif Shared.Core == 'esx' and ESX.IsPlayerLoaded() then
1517
Radio:ESXInit()
18+
Radio.playerLoaded = true
1619
end
1720
end
1821
end)

client/function.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ lib.addKeybind({
173173
CreateThread(function()
174174
while true do
175175
Wait(1000)
176-
if LocalPlayer.state.isLoggedIn then
176+
if Radio.playerLoaded then
177177
if not Radio.hasRadio and Radio.onRadio and Shared.Inventory then
178178
Radio:leaveradio()
179179
end

client/interface.lua

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ end
66

77
Radio = {
88
playerServerID = GetPlayerServerId(PlayerId()),
9+
playerLoaded = false,
910
PlayerJob = 'civilian',
1011
PlayerGang = 'none',
1112
PlayerDuty = false,

fxmanifest.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ fx_version 'cerulean'
22
game "gta5"
33

44
author "Master Mind"
5-
version '1.8.0'
5+
version '1.8.1'
66

77
lua54 'yes'
88

0 commit comments

Comments
 (0)