mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 06:56:03 +01:00
refactor(player/client): create player instance at init
And minor fixes.
This commit is contained in:
@@ -3,7 +3,7 @@ CPlayer.__index = CPlayer
|
||||
|
||||
function CPlayer:getCoords(update)
|
||||
if update or not self.coords then
|
||||
self.coords = GetEntityCoords(self.ped)
|
||||
self.coords = GetEntityCoords(cache.ped)
|
||||
end
|
||||
|
||||
return self.coords
|
||||
@@ -20,7 +20,8 @@ end
|
||||
function lib.getPlayer()
|
||||
return setmetatable({
|
||||
id = cache.playerId,
|
||||
ped = cache.ped,
|
||||
serverId = cache.serverId,
|
||||
}, CPlayer)
|
||||
end
|
||||
|
||||
player = lib.getPlayer()
|
||||
|
||||
Reference in New Issue
Block a user