Files
ox_lib/imports/player/client.lua
2022-05-29 10:33:41 +10:00

28 lines
440 B
Lua

local CPlayer = {}
function CPlayer:__index(index, ...)
local method = CPlayer[index]
if method then
return function(...)
return method(self, ...)
end
end
end
function CPlayer:getCoords(update)
if update or not self.coords then
self.coords = GetEntityCoords(cache.ped)
end
return self.coords
end
function CPlayer:getDistance(coords)
return #(self:getCoords() - coords)
end
function lib.getPlayer()
return CPlayer
end