chore: add copyright notices to each file

Some people accidentally, mistakenly, and without any malicious intent forget to attribute code from this resource to its source. This change will hopefully assist people, so that they do not make that mistake again.
This commit is contained in:
Linden
2025-03-18 18:46:09 +11:00
parent dc6f7fa091
commit fb2225e373
72 changed files with 739 additions and 206 deletions

View File

@@ -1,6 +1,14 @@
-- DO NOT USE! Old syntax for addCommand (prior to v3.0) -- DO NOT USE! Old syntax for addCommand (prior to v3.0)
---@todo convert input and call standard function? ---@todo convert input and call standard function?
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
local commands = {} local commands = {}
SetTimeout(1000, function() SetTimeout(1000, function()

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---@class OxCommandParams ---@class OxCommandParams
---@field name string ---@field name string
---@field help? string ---@field help? string

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
if cache.game == 'redm' then return end if cache.game == 'redm' then return end
---@class KeybindProps ---@class KeybindProps

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---@class Array<T> : OxClass, { [number]: T } ---@class Array<T> : OxClass, { [number]: T }
lib.array = lib.class('Array') lib.array = lib.class('Array')

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
local pendingCallbacks = {} local pendingCallbacks = {}
local timers = {} local timers = {}
local cbEvent = '__ox_cb_%s' local cbEvent = '__ox_cb_%s'

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
local pendingCallbacks = {} local pendingCallbacks = {}
local cbEvent = '__ox_cb_%s' local cbEvent = '__ox_cb_%s'
local callbackTimeout = GetConvarInt('ox:callbackTimeout', 300000) local callbackTimeout = GetConvarInt('ox:callbackTimeout', 300000)

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---@diagnostic disable: invisible ---@diagnostic disable: invisible
local getinfo = debug.getinfo local getinfo = debug.getinfo

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
lib.cron = {} lib.cron = {}
---@alias Date { year: number, month: number, day: number, hour: number, min: number, sec: number, wday: number, yday: number, isdst: boolean } ---@alias Date { year: number, month: number, day: number, hour: number, min: number, sec: number, wday: number, yday: number, isdst: boolean }

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
--- Call on frame to disable all stored keys. --- Call on frame to disable all stored keys.
--- ``` --- ```
--- disableControls() --- disableControls()

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---@class DuiProperties ---@class DuiProperties
---@field url string ---@field url string
---@field width number ---@field width number

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---@param coords vector3 The coords to check from. ---@param coords vector3 The coords to check from.
---@param maxDistance? number The max distance to check. ---@param maxDistance? number The max distance to check.
---@return number? object ---@return number? object

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---@param coords vector3 The coords to check from. ---@param coords vector3 The coords to check from.
---@param maxDistance? number The max distance to check. ---@param maxDistance? number The max distance to check.
---@return number? ped ---@return number? ped

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---@param coords vector3 The coords to check from. ---@param coords vector3 The coords to check from.
---@param maxDistance? number The max distance to check. ---@param maxDistance? number The max distance to check.
---@param includePlayer? boolean Whether or not to include the current player. ---@param includePlayer? boolean Whether or not to include the current player.

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---@param coords vector3 The coords to check from. ---@param coords vector3 The coords to check from.
---@param maxDistance? number The max distance to check. ---@param maxDistance? number The max distance to check.
---@return number? playerId ---@return number? playerId

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---@param coords vector3 The coords to check from. ---@param coords vector3 The coords to check from.
---@param maxDistance? number The max distance to check. ---@param maxDistance? number The max distance to check.
---@param includePlayerVehicle? boolean Whether or not to include the player's current vehicle. Ignored on the server. ---@param includePlayerVehicle? boolean Whether or not to include the player's current vehicle. Ignored on the server.

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---@param path string ---@param path string
---@param pattern string ---@param pattern string
---@return table string[] ---@return table string[]

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---@param coords vector3 The coords to check from. ---@param coords vector3 The coords to check from.
---@param maxDistance? number The max distance to check. ---@param maxDistance? number The max distance to check.
---@return { object: number, coords: vector3 }[] ---@return { object: number, coords: vector3 }[]

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---@param coords vector3 The coords to check from. ---@param coords vector3 The coords to check from.
---@param maxDistance? number The max distance to check. ---@param maxDistance? number The max distance to check.
---@return { ped: number, coords: vector3 }[] ---@return { ped: number, coords: vector3 }[]

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---@param coords vector3 The coords to check from. ---@param coords vector3 The coords to check from.
---@param maxDistance? number The max distance to check. ---@param maxDistance? number The max distance to check.
---@param includePlayer? boolean Whether or not to include the current player. ---@param includePlayer? boolean Whether or not to include the current player.

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---@param coords vector3 The coords to check from. ---@param coords vector3 The coords to check from.
---@param maxDistance? number The max distance to check. ---@param maxDistance? number The max distance to check.
---@return { id: number, ped: number, coords: vector3 }[] ---@return { id: number, ped: number, coords: vector3 }[]

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---@param coords vector3 The coords to check from. ---@param coords vector3 The coords to check from.
---@param maxDistance? number The max distance to check. ---@param maxDistance? number The max distance to check.
---@param includePlayerVehicle? boolean Whether or not to include the player's current vehicle. ---@param includePlayerVehicle? boolean Whether or not to include the player's current vehicle.

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
local glm_sincos = require 'glm'.sincos --[[@as fun(n: number): number, number]] local glm_sincos = require 'glm'.sincos --[[@as fun(n: number): number, number]]
local glm_rad = require 'glm'.rad --[[@as fun(n: number): number]] local glm_rad = require 'glm'.rad --[[@as fun(n: number): number]]

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---@type { [string]: string } ---@type { [string]: string }
local dict = {} local dict = {}

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
local service = GetConvar('ox:logger', 'datadog') local service = GetConvar('ox:logger', 'datadog')
local buffer local buffer
local bufferSize = 0 local bufferSize = 0

View File

@@ -1,165 +1,173 @@
---@diagnostic disable: param-type-mismatch --[[
lib.marker = {} https://github.com/overextended/ox_lib
local defaultRotation = vector3(0, 0, 0) This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
local defaultDirection = vector3(0, 0, 0)
local defaultColor = { r = 255, g = 255, b = 255, a = 100 } Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
local defaultSize = { width = 2, height = 1 } ]]
local defaultTextureDict = nil
local defaultTextureName = nil ---@diagnostic disable: param-type-mismatch
lib.marker = {}
local markerTypesMap = {
UpsideDownCone = 0, local defaultRotation = vector3(0, 0, 0)
VerticalCylinder = 1, local defaultDirection = vector3(0, 0, 0)
ThickChevronUp = 2, local defaultColor = { r = 255, g = 255, b = 255, a = 100 }
ThinChevronUp = 3, local defaultSize = { width = 2, height = 1 }
CheckeredFlagRect = 4, local defaultTextureDict = nil
CheckeredFlagCircle = 5, local defaultTextureName = nil
VerticleCircle = 6,
PlaneModel = 7, local markerTypesMap = {
LostMCTransparent = 8, UpsideDownCone = 0,
LostMC = 9, VerticalCylinder = 1,
Number0 = 10, ThickChevronUp = 2,
Number1 = 11, ThinChevronUp = 3,
Number2 = 12, CheckeredFlagRect = 4,
Number3 = 13, CheckeredFlagCircle = 5,
Number4 = 14, VerticleCircle = 6,
Number5 = 15, PlaneModel = 7,
Number6 = 16, LostMCTransparent = 8,
Number7 = 17, LostMC = 9,
Number8 = 18, Number0 = 10,
Number9 = 19, Number1 = 11,
ChevronUpx1 = 20, Number2 = 12,
ChevronUpx2 = 21, Number3 = 13,
ChevronUpx3 = 22, Number4 = 14,
HorizontalCircleFat = 23, Number5 = 15,
ReplayIcon = 24, Number6 = 16,
HorizontalCircleSkinny = 25, Number7 = 17,
HorizontalCircleSkinny_Arrow = 26, Number8 = 18,
HorizontalSplitArrowCircle = 27, Number9 = 19,
DebugSphere = 28, ChevronUpx1 = 20,
DollarSign = 29, ChevronUpx2 = 21,
HorizontalBars = 30, ChevronUpx3 = 22,
WolfHead = 31, HorizontalCircleFat = 23,
QuestionMark = 32, ReplayIcon = 24,
PlaneSymbol = 33, HorizontalCircleSkinny = 25,
HelicopterSymbol = 34, HorizontalCircleSkinny_Arrow = 26,
BoatSymbol = 35, HorizontalSplitArrowCircle = 27,
CarSymbol = 36, DebugSphere = 28,
MotorcycleSymbol = 37, DollarSign = 29,
BikeSymbol = 38, HorizontalBars = 30,
TruckSymbol = 39, WolfHead = 31,
ParachuteSymbol = 40, QuestionMark = 32,
Unknown41 = 41, PlaneSymbol = 33,
SawbladeSymbol = 42, HelicopterSymbol = 34,
Unknown43 = 43, BoatSymbol = 35,
} CarSymbol = 36,
MotorcycleSymbol = 37,
---@alias MarkerType BikeSymbol = 38,
---| "UpsideDownCone" TruckSymbol = 39,
---| "VerticalCylinder" ParachuteSymbol = 40,
---| "ThickChevronUp" Unknown41 = 41,
---| "ThinChevronUp" SawbladeSymbol = 42,
---| "CheckeredFlagRect" Unknown43 = 43,
---| "CheckeredFlagCircle" }
---| "VerticleCircle"
---| "PlaneModel" ---@alias MarkerType
---| "LostMCTransparent" ---| "UpsideDownCone"
---| "LostMC" ---| "VerticalCylinder"
---| "Number0" ---| "ThickChevronUp"
---| "Number1" ---| "ThinChevronUp"
---| "Number2" ---| "CheckeredFlagRect"
---| "Number3" ---| "CheckeredFlagCircle"
---| "Number4" ---| "VerticleCircle"
---| "Number5" ---| "PlaneModel"
---| "Number6" ---| "LostMCTransparent"
---| "Number7" ---| "LostMC"
---| "Number8" ---| "Number0"
---| "Number9" ---| "Number1"
---| "ChevronUpx1" ---| "Number2"
---| "ChevronUpx2" ---| "Number3"
---| "ChevronUpx3" ---| "Number4"
---| "HorizontalCircleFat" ---| "Number5"
---| "ReplayIcon" ---| "Number6"
---| "HorizontalCircleSkinny" ---| "Number7"
---| "HorizontalCircleSkinny_Arrow" ---| "Number8"
---| "HorizontalSplitArrowCircle" ---| "Number9"
---| "DebugSphere" ---| "ChevronUpx1"
---| "DollarSign" ---| "ChevronUpx2"
---| "HorizontalBars" ---| "ChevronUpx3"
---| "WolfHead" ---| "HorizontalCircleFat"
---| "QuestionMark" ---| "ReplayIcon"
---| "PlaneSymbol" ---| "HorizontalCircleSkinny"
---| "HelicopterSymbol" ---| "HorizontalCircleSkinny_Arrow"
---| "BoatSymbol" ---| "HorizontalSplitArrowCircle"
---| "CarSymbol" ---| "DebugSphere"
---| "MotorcycleSymbol" ---| "DollarSign"
---| "BikeSymbol" ---| "HorizontalBars"
---| "TruckSymbol" ---| "WolfHead"
---| "ParachuteSymbol" ---| "QuestionMark"
---| "Unknown41" ---| "PlaneSymbol"
---| "SawbladeSymbol" ---| "HelicopterSymbol"
---| "Unknown43" ---| "BoatSymbol"
---| "CarSymbol"
---@class MarkerProps ---| "MotorcycleSymbol"
---@field type MarkerType | number ---| "BikeSymbol"
---@field coords { x: number, y: number, z: number } ---| "TruckSymbol"
---@field width? number ---| "ParachuteSymbol"
---@field height? number ---| "Unknown41"
---@field color? { r: number, g: number, b: number, a: number } ---| "SawbladeSymbol"
---@field rotation? { x: number, y: number, z: number } ---| "Unknown43"
---@field direction? { x: number, y: number, z: number }
---@field bobUpAndDown? boolean ---@class MarkerProps
---@field faceCamera? boolean ---@field type MarkerType | number
---@field rotate? boolean ---@field coords { x: number, y: number, z: number }
---@field textureDict? string ---@field width? number
---@field textureName? string ---@field height? number
---@field color? { r: number, g: number, b: number, a: number }
---@param self MarkerProps ---@field rotation? { x: number, y: number, z: number }
local function drawMarker(self) ---@field direction? { x: number, y: number, z: number }
DrawMarker( ---@field bobUpAndDown? boolean
self.type, ---@field faceCamera? boolean
self.coords.x, self.coords.y, self.coords.z, ---@field rotate? boolean
self.direction.x, self.direction.y, self.direction.z, ---@field textureDict? string
self.rotation.x, self.rotation.y, self.rotation.z, ---@field textureName? string
self.width, self.width, self.height,
self.color.r, self.color.g, self.color.b, self.color.a, ---@param self MarkerProps
self.bobUpAndDown, self.faceCamera, 2, self.rotate, self.textureDict, self.textureName, false) local function drawMarker(self)
end DrawMarker(
self.type,
---@param options MarkerProps self.coords.x, self.coords.y, self.coords.z,
function lib.marker.new(options) self.direction.x, self.direction.y, self.direction.z,
local markerType self.rotation.x, self.rotation.y, self.rotation.z,
if type(options.type) == "string" then self.width, self.width, self.height,
markerType = markerTypesMap[options.type] self.color.r, self.color.g, self.color.b, self.color.a,
if markerType == nil then self.bobUpAndDown, self.faceCamera, 2, self.rotate, self.textureDict, self.textureName, false)
error(("unknown marker type '%s'"):format(options.type)) end
end
elseif type(options.type) == "number" then ---@param options MarkerProps
markerType = options.type function lib.marker.new(options)
else local markerType
error(("expected marker type to have type 'string' or 'number' (received %s)"):format(type(options.type))) if type(options.type) == "string" then
end markerType = markerTypesMap[options.type]
if markerType == nil then
local self = {} error(("unknown marker type '%s'"):format(options.type))
self.type = markerType end
self.coords = options.coords elseif type(options.type) == "number" then
self.color = options.color or defaultColor markerType = options.type
self.width = options.width or defaultSize.width else
self.height = options.height or defaultSize.height error(("expected marker type to have type 'string' or 'number' (received %s)"):format(type(options.type)))
self.rotation = options.rotation or defaultRotation end
self.direction = options.direction or defaultDirection
self.bobUpAndDown = type(options.bobUpAndDown) == 'boolean' and options.bobUpAndDown local self = {}
self.faceCamera = type(options.faceCamera) ~= 'boolean' or options.faceCamera self.type = markerType
self.rotate = type(options.rotate) == 'boolean' and options.rotate self.coords = options.coords
self.textureDict = options.textureDict or defaultTextureDict self.color = options.color or defaultColor
self.textureName = options.textureName or defaultTextureName self.width = options.width or defaultSize.width
self.draw = drawMarker self.height = options.height or defaultSize.height
self.rotation = options.rotation or defaultRotation
self.width += 0.0 self.direction = options.direction or defaultDirection
self.height += 0.0 self.bobUpAndDown = type(options.bobUpAndDown) == 'boolean' and options.bobUpAndDown
self.faceCamera = type(options.faceCamera) ~= 'boolean' or options.faceCamera
return self self.rotate = type(options.rotate) == 'boolean' and options.rotate
end self.textureDict = options.textureDict or defaultTextureDict
self.textureName = options.textureName or defaultTextureName
return lib.marker self.draw = drawMarker
self.width += 0.0
self.height += 0.0
return self
end
return lib.marker

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---@class oxmath : mathlib ---@class oxmath : mathlib
lib.math = math lib.math = math

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---@alias AnimationFlags number ---@alias AnimationFlags number
---| 0 DEFAULT ---| 0 DEFAULT
---| 1 LOOPING ---| 1 LOOPING

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---@class PointProperties ---@class PointProperties
---@field coords vector3 ---@field coords vector3
---@field distance number ---@field distance number

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---@enum PrintLevel ---@enum PrintLevel
local printLevel = { local printLevel = {
error = 1, error = 1,

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
lib.raycast = {} lib.raycast = {}
local StartShapeTestLosProbe = StartShapeTestLosProbe local StartShapeTestLosProbe = StartShapeTestLosProbe

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---Load an animation dictionary. When called from a thread, it will yield until it has loaded. ---Load an animation dictionary. When called from a thread, it will yield until it has loaded.
---@param animDict string ---@param animDict string
---@param timeout number? Approximate milliseconds to wait for the dictionary to load. Default is 10000. ---@param timeout number? Approximate milliseconds to wait for the dictionary to load. Default is 10000.

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---Load an animation clipset. When called from a thread, it will yield until it has loaded. ---Load an animation clipset. When called from a thread, it will yield until it has loaded.
---@param animSet string ---@param animSet string
---@param timeout number? Approximate milliseconds to wait for the clipset to load. Default is 10000. ---@param timeout number? Approximate milliseconds to wait for the clipset to load. Default is 10000.

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---Loads an audio bank. ---Loads an audio bank.
---@param audioBank string ---@param audioBank string
---@param timeout number? ---@param timeout number?

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---Load a model. When called from a thread, it will yield until it has loaded. ---Load a model. When called from a thread, it will yield until it has loaded.
---@param model number | string ---@param model number | string
---@param timeout number? Approximate milliseconds to wait for the model to load. Default is 10000. ---@param timeout number? Approximate milliseconds to wait for the model to load. Default is 10000.

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---Load a named particle effect. When called from a thread, it will yield until it has loaded. ---Load a named particle effect. When called from a thread, it will yield until it has loaded.
---@param ptFxName string ---@param ptFxName string
---@param timeout number? Approximate milliseconds to wait for the particle effect to load. Default is 10000. ---@param timeout number? Approximate milliseconds to wait for the particle effect to load. Default is 10000.

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---Load a scaleform movie. When called from a thread, it will yield until it has loaded. ---Load a scaleform movie. When called from a thread, it will yield until it has loaded.
---@param scaleformName string ---@param scaleformName string
---@param timeout number? Approximate milliseconds to wait for the scaleform movie to load. Default is 1000. ---@param timeout number? Approximate milliseconds to wait for the scaleform movie to load. Default is 1000.

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---Load a texture dictionary. When called from a thread, it will yield until it has loaded. ---Load a texture dictionary. When called from a thread, it will yield until it has loaded.
---@param textureDict string ---@param textureDict string
---@param timeout number? Approximate milliseconds to wait for the dictionary to load. Default is 10000. ---@param timeout number? Approximate milliseconds to wait for the dictionary to load. Default is 10000.

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---@alias WeaponResourceFlags ---@alias WeaponResourceFlags
---| 1 WRF_REQUEST_BASE_ANIMS ---| 1 WRF_REQUEST_BASE_ANIMS
---| 2 WRF_REQUEST_COVER_ANIMS ---| 2 WRF_REQUEST_COVER_ANIMS

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
local loaded = {} local loaded = {}
local _require = require local _require = require

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---@class renderTargetTable ---@class renderTargetTable
---@field name string ---@field name string
---@field model string | number ---@field model string | number

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---@async ---@async
---@generic T : string | number ---@generic T : string | number
---@param request function ---@param request function

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---@class oxstring : stringlib ---@class oxstring : stringlib
lib.string = string lib.string = string

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
-- Add additional functions to the standard table library -- Add additional functions to the standard table library
---@class oxtable : tablelib ---@class oxtable : tablelib

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---@class TimerPrivateProps ---@class TimerPrivateProps
---@field initialTime number the initial duration of the timer. ---@field initialTime number the initial duration of the timer.
---@field async? boolean wether the timer should run asynchronously or not ---@field async? boolean wether the timer should run asynchronously or not

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---Triggers an event for the given playerIds, sending additional parameters as arguments.\ ---Triggers an event for the given playerIds, sending additional parameters as arguments.\
---Implements functionality from [this pending pull request](https://github.com/citizenfx/fivem/pull/1210) and may be deprecated. ---Implements functionality from [this pending pull request](https://github.com/citizenfx/fivem/pull/1210) and may be deprecated.
--- ---

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---Yields the current thread until a non-nil value is returned by the function. ---Yields the current thread until a non-nil value is returned by the function.
---@generic T ---@generic T
---@param cb fun(): T? ---@param cb fun(): T?

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
local glm = require 'glm' local glm = require 'glm'
---@class ZoneProperties ---@class ZoneProperties

View File

@@ -1,7 +1,11 @@
---@meta ---@meta
---ox_lib <https://github.com/overextended/ox_lib> --[[
---Copyright (C) 2021 Linden <https://github.com/thelindat> https://github.com/overextended/ox_lib
---LGPL-3.0-or-later <https://www.gnu.org/licenses/lgpl-3.0.en.html>
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
if not _VERSION:find('5.4') then if not _VERSION:find('5.4') then
error('Lua 5.4 must be enabled in the resource manifest!', 2) error('Lua 5.4 must be enabled in the resource manifest!', 2)

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
local function allowAce(allow) local function allowAce(allow)
return allow == false and 'deny' or 'allow' return allow == false and 'deny' or 'allow'
end end

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
local cache = _ENV.cache local cache = _ENV.cache
cache.playerId = PlayerId() cache.playerId = PlayerId()
cache.serverId = GetPlayerServerId(cache.playerId) cache.serverId = GetPlayerServerId(cache.playerId)

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
local registeredCallbacks = {} local registeredCallbacks = {}
AddEventHandler('onResourceStop', function(resourceName) AddEventHandler('onResourceStop', function(resourceName)

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
local _registerCommand = RegisterCommand local _registerCommand = RegisterCommand
---@param commandName string ---@param commandName string

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---@type promise? ---@type promise?
local alert = nil local alert = nil
local alertId = 0 local alertId = 0

View File

@@ -1,7 +1,15 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---@param value string ---@param value string
function lib.setClipboard(value) function lib.setClipboard(value)
SendNUIMessage({ SendNUIMessage({
action = 'setClipboard', action = 'setClipboard',
data = value data = value
}) })
end end

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
local contextMenus = {} local contextMenus = {}
local openContextMenu = nil local openContextMenu = nil

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
local input local input
---@class InputDialogRowProps ---@class InputDialogRowProps

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---@alias IconProp 'fas' | 'far' | 'fal' | 'fat' | 'fad' | 'fab' | 'fak' | 'fass' ---@alias IconProp 'fas' | 'far' | 'fal' | 'fat' | 'fad' | 'fab' | 'fak' | 'fass'
local keepInput = IsNuiFocusKeepingInput() local keepInput = IsNuiFocusKeepingInput()

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---@type { [string]: MenuProps } ---@type { [string]: MenuProps }
local registeredMenus = {} local registeredMenus = {}
---@type MenuProps | nil ---@type MenuProps | nil

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---@alias NotificationPosition 'top' | 'top-right' | 'top-left' | 'bottom' | 'bottom-right' | 'bottom-left' | 'center-right' | 'center-left' ---@alias NotificationPosition 'top' | 'top-right' | 'top-left' | 'bottom' | 'bottom-right' | 'bottom-left' | 'center-right' | 'center-left'
---@alias NotificationType 'info' | 'warning' | 'success' | 'error' ---@alias NotificationType 'info' | 'warning' | 'success' | 'error'
---@alias IconAnimationType 'spin' | 'spinPulse' | 'spinReverse' | 'pulse' | 'beat' | 'fade' | 'beatFade' | 'bounce' | 'shake' ---@alias IconAnimationType 'spin' | 'spinPulse' | 'spinReverse' | 'pulse' | 'beat' | 'fade' | 'beatFade' | 'bounce' | 'shake'

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
local progress local progress
local DisableControlAction = DisableControlAction local DisableControlAction = DisableControlAction
local DisablePlayerFiring = DisablePlayerFiring local DisablePlayerFiring = DisablePlayerFiring

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---@class RadialItem ---@class RadialItem
---@field icon string | {[1]: IconProp, [2]: string}; ---@field icon string | {[1]: IconProp, [2]: string};
---@field label string ---@field label string

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---@type promise? ---@type promise?
local skillcheck local skillcheck

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---@class TextUIOptions ---@class TextUIOptions
---@field position? 'right-center' | 'left-center' | 'top-center' | 'bottom-center'; ---@field position? 'right-center' | 'left-center' | 'top-center' | 'bottom-center';
---@field icon? string | {[1]: IconProp, [2]: string}; ---@field icon? string | {[1]: IconProp, [2]: string};
@@ -38,4 +46,4 @@ end
---@return boolean, string | nil ---@return boolean, string | nil
function lib.isTextUIOpen() function lib.isTextUIOpen()
return isOpen, currentText return isOpen, currentText
end end

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
if GetConvarInt('ox:txAdminNotifications', 0) == 0 then return end if GetConvarInt('ox:txAdminNotifications', 0) == 0 then return end
if GetConvarInt('txAdmin-hideDefaultAnnouncement', 0) == 1 then if GetConvarInt('txAdmin-hideDefaultAnnouncement', 0) == 1 then

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
local settings = require 'resource.settings' local settings = require 'resource.settings'
local function loadLocaleFile(key) local function loadLocaleFile(key)

View File

@@ -1 +1,9 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
function lib.getLocaleKey() return GetConvar('ox:locale', 'en') end function lib.getLocaleKey() return GetConvar('ox:locale', 'en') end

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
if cache.game == 'redm' then return end if cache.game == 'redm' then return end
---@class VehicleProperties ---@class VehicleProperties

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
---@param vehicle number ---@param vehicle number
---@param props VehicleProperties ---@param props VehicleProperties
---@diagnostic disable-next-line: duplicate-set-field ---@diagnostic disable-next-line: duplicate-set-field

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
function lib.versionCheck(repository) function lib.versionCheck(repository)
local resource = GetInvokingResource() or GetCurrentResourceName() local resource = GetInvokingResource() or GetCurrentResourceName()

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
function lib.checkDependency(resource, minimumVersion, printMessage) function lib.checkDependency(resource, minimumVersion, printMessage)
local currentVersion = GetResourceMetadata(resource, 'version', 0) local currentVersion = GetResourceMetadata(resource, 'version', 0)
currentVersion = currentVersion and currentVersion:match('%d+%.%d+%.%d+') or 'unknown' currentVersion = currentVersion and currentVersion:match('%d+%.%d+%.%d+') or 'unknown'

View File

@@ -1,3 +1,11 @@
--[[
https://github.com/overextended/ox_lib
This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
]]
local creatorActive = false local creatorActive = false
local controlsActive = false local controlsActive = false
local zoneType, step, xCoord, yCoord, zCoord, heading, height, width, length local zoneType, step, xCoord, yCoord, zCoord, heading, height, width, length

View File

@@ -1,40 +1,9 @@
--[[ --[[
-- function https://github.com/overextended/ox_lib
local poly = lib.zones.poly({
name = poly, This file is licensed under LGPL-3.0 or higher <https://www.gnu.org/licenses/lgpl-3.0.en.html>
points = {
vec(447.9, -998.8, 25.8), Copyright (c) 2025 Linden <https://github.com/thelindat/fivem>
vec(450.3, -998.2, 25.8),
vec(449.9, -995.5, 25.8),
vec(447.2, -995.6, 25.8),
vec(446.3, -997.9, 25.8),
},
thickness = 2,
})
-- array
{
name = poly,
points = {
vec(447.9, -998.8, 25.8),
vec(450.3, -998.2, 25.8),
vec(449.9, -995.5, 25.8),
vec(447.2, -995.6, 25.8),
vec(446.3, -997.9, 25.8),
},
thickness = 2,
},
-- target
exports.ox_target:addPolyZone({
name = poly,
points = {
vec(447.9, -998.8, 25.8),
vec(450.3, -998.2, 25.8),
vec(449.9, -995.5, 25.8),
vec(447.2, -995.6, 25.8),
vec(446.3, -997.9, 25.8),
},
thickness = 2,
})
]] ]]
local function formatNumber(num) local function formatNumber(num)