Skip to content

Commit

Permalink
docs(es_extended/server/onesync.lua): fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
CsokiHUN committed Feb 7, 2023
1 parent f0d00f9 commit 3919780
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions [core]/es_extended/server/onesync.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
ESX.OneSync = {}

---@class vector3
---@field x number
---@field y number
---@field z number

---@param source number|vector3
---@param closest boolean
---@param distance? number
---@param ignore? table
local function getNearbyPlayers(source, closest, distance, ignore)
local result = {}
local count = 0
Expand Down Expand Up @@ -44,22 +43,22 @@ end

---@param source vector3|number playerId or vector3 coordinates
---@param maxDistance number
---@param ignore table playerIds to ignore, where the key is playerId and value is true
---@param ignore? table playerIds to ignore, where the key is playerId and value is true
function ESX.OneSync.GetPlayersInArea(source, maxDistance, ignore)
return getNearbyPlayers(source, false, maxDistance, ignore)
end

---@param source vector3|number playerId or vector3 coordinates
---@param maxDistance number
---@param ignore table playerIds to ignore, where the key is playerId and value is true
---@param ignore? table playerIds to ignore, where the key is playerId and value is true
function ESX.OneSync.GetClosestPlayer(source, maxDistance, ignore)
return getNearbyPlayers(source, true, maxDistance, ignore)
end

---@param model number|string
---@param coords vector3|table
---@param heading number
---@param Properties table
---@param properties table
---@param cb function
function ESX.OneSync.SpawnVehicle(model, coords, heading, properties, cb)
local vehicleModel = joaat(model)
Expand Down

0 comments on commit 3919780

Please sign in to comment.