2022-09-14 01:20:50 +10:00
|
|
|
--[[
|
|
|
|
|
This module was experimental and won't be worked on or used further.
|
|
|
|
|
May be removed in the future.
|
|
|
|
|
]]
|
|
|
|
|
|
2022-05-12 01:52:44 +10:00
|
|
|
local CPlayer = {}
|
2022-05-29 10:29:52 +10:00
|
|
|
|
|
|
|
|
function CPlayer:__index(index, ...)
|
|
|
|
|
local method = CPlayer[index]
|
|
|
|
|
|
|
|
|
|
if method then
|
|
|
|
|
return function(...)
|
|
|
|
|
return method(self, ...)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
2022-05-12 01:52:44 +10:00
|
|
|
|
2022-05-12 07:41:12 +10:00
|
|
|
function CPlayer:getCoords(update)
|
|
|
|
|
if update or not self.coords then
|
2022-05-28 21:30:17 +10:00
|
|
|
self.coords = GetEntityCoords(cache.ped)
|
2022-05-12 01:52:44 +10:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return self.coords
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function CPlayer:getDistance(coords)
|
|
|
|
|
return #(self:getCoords() - coords)
|
|
|
|
|
end
|
|
|
|
|
|
2022-09-14 01:20:50 +10:00
|
|
|
---@deprecated
|
2022-05-12 07:41:12 +10:00
|
|
|
function lib.getPlayer()
|
2022-05-29 10:29:52 +10:00
|
|
|
return CPlayer
|
2022-05-12 01:52:44 +10:00
|
|
|
end
|