mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-08-29 01:08:57 +00:00
backwards compat testing
This commit is contained in:
+15
-5
@@ -435,11 +435,21 @@ function Player:Logout()
|
||||
end
|
||||
|
||||
function Player.new(PlayerData, Offline)
|
||||
local self = {
|
||||
PlayerData = PlayerData,
|
||||
Offline = Offline
|
||||
}
|
||||
return setmetatable(self, Player)
|
||||
local self = setmetatable({}, Player)
|
||||
self.PlayerData = PlayerData
|
||||
self.Offline = Offline
|
||||
self.Functions = setmetatable({}, {
|
||||
__index = function(_, key)
|
||||
if Player[key] and type(Player[key]) == 'function' then
|
||||
return function(...)
|
||||
return Player[key](self, ...)
|
||||
end
|
||||
else
|
||||
error("Attempt to call undefined function '" .. key .. "'")
|
||||
end
|
||||
end
|
||||
})
|
||||
return self
|
||||
end
|
||||
|
||||
function QBCore.Player.CreatePlayer(PlayerData, Offline)
|
||||
|
||||
Reference in New Issue
Block a user