Files
ox_lib/imports/player/server.lua

39 lines
658 B
Lua
Raw Normal View History

--[[
This module was experimental and won't be worked on or used further.
May be removed in the future.
]]
2022-05-29 10:28:35 +10:00
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(self.getPed())
end
return self.coords
end
function CPlayer:getDistance(coords)
return #(self:getCoords() - coords)
end
function CPlayer:getPed()
self.ped = GetPlayerPed(self.source)
2022-05-29 10:28:35 +10:00
return self.ped
end
---@deprecated
2022-05-29 10:28:35 +10:00
function lib.getPlayer()
return CPlayer
end