mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-18 23:46:03 +01:00
tweak(init): store serverId
This commit is contained in:
@@ -60,4 +60,3 @@ server_scripts {
|
|||||||
'resource/**/server/*.lua'
|
'resource/**/server/*.lua'
|
||||||
}
|
}
|
||||||
|
|
||||||
provide 'pe-lualib'
|
|
||||||
|
|||||||
7
init.lua
7
init.lua
@@ -152,7 +152,7 @@ local ox = GetResourceState('ox_core') ~= 'missing' and setmetatable({}, {
|
|||||||
groups = GetResourceState('ox_groups') ~= 'missing',
|
groups = GetResourceState('ox_groups') ~= 'missing',
|
||||||
}
|
}
|
||||||
|
|
||||||
local cache_mt = {
|
local cache = setmetatable({}, {
|
||||||
__index = function(self, key)
|
__index = function(self, key)
|
||||||
return rawset(self, key, exports[lualib]['cache'](nil, key) or false)[key]
|
return rawset(self, key, exports[lualib]['cache'](nil, key) or false)[key]
|
||||||
end,
|
end,
|
||||||
@@ -164,6 +164,7 @@ local cache_mt = {
|
|||||||
|
|
||||||
else
|
else
|
||||||
self.playerId = PlayerId()
|
self.playerId = PlayerId()
|
||||||
|
self.serverId = GetPlayerServerId(self.playerId)
|
||||||
end
|
end
|
||||||
|
|
||||||
if ox.groups then
|
if ox.groups then
|
||||||
@@ -175,9 +176,7 @@ local cache_mt = {
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
}
|
})
|
||||||
|
|
||||||
local cache = setmetatable({}, cache_mt)
|
|
||||||
|
|
||||||
Citizen.CreateThreadNow(function()
|
Citizen.CreateThreadNow(function()
|
||||||
while true do
|
while true do
|
||||||
|
|||||||
Reference in New Issue
Block a user