mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-18 15:36:02 +01:00
refactor(getCore/client): instantiate player
Previously handled by the player module.
This commit is contained in:
@@ -11,7 +11,16 @@ return function(resource)
|
||||
ESX.PlayerData.job = job
|
||||
end)
|
||||
|
||||
lib.addPlayerMethod('hasGroup', function(_, filter)
|
||||
local CPlayer = lib.getPlayer()
|
||||
|
||||
function lib.getPlayer()
|
||||
return setmetatable({
|
||||
id = cache.playerId,
|
||||
serverId = cache.serverId,
|
||||
}, CPlayer)
|
||||
end
|
||||
|
||||
function CPlayer:hasGroup(filter)
|
||||
local data = ESX.PlayerData
|
||||
local type = type(filter)
|
||||
|
||||
@@ -36,7 +45,9 @@ return function(resource)
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
player = lib.getPlayer()
|
||||
|
||||
return ESX
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user