mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-16 22:46:03 +01:00
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:
@@ -1,6 +1,14 @@
|
||||
-- DO NOT USE! Old syntax for addCommand (prior to v3.0)
|
||||
---@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 = {}
|
||||
|
||||
SetTimeout(1000, function()
|
||||
|
||||
@@ -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
|
||||
---@field name string
|
||||
---@field help? string
|
||||
|
||||
@@ -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
|
||||
|
||||
---@class KeybindProps
|
||||
|
||||
@@ -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 }
|
||||
lib.array = lib.class('Array')
|
||||
|
||||
|
||||
@@ -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 timers = {}
|
||||
local cbEvent = '__ox_cb_%s'
|
||||
|
||||
@@ -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 cbEvent = '__ox_cb_%s'
|
||||
local callbackTimeout = GetConvarInt('ox:callbackTimeout', 300000)
|
||||
|
||||
@@ -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
|
||||
local getinfo = debug.getinfo
|
||||
|
||||
|
||||
@@ -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 = {}
|
||||
|
||||
---@alias Date { year: number, month: number, day: number, hour: number, min: number, sec: number, wday: number, yday: number, isdst: boolean }
|
||||
|
||||
@@ -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.
|
||||
--- ```
|
||||
--- disableControls()
|
||||
|
||||
@@ -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
|
||||
---@field url string
|
||||
---@field width number
|
||||
|
||||
@@ -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 maxDistance? number The max distance to check.
|
||||
---@return number? object
|
||||
|
||||
@@ -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 maxDistance? number The max distance to check.
|
||||
---@return number? ped
|
||||
|
||||
@@ -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 maxDistance? number The max distance to check.
|
||||
---@param includePlayer? boolean Whether or not to include the current player.
|
||||
|
||||
@@ -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 maxDistance? number The max distance to check.
|
||||
---@return number? playerId
|
||||
|
||||
@@ -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 maxDistance? number The max distance to check.
|
||||
---@param includePlayerVehicle? boolean Whether or not to include the player's current vehicle. Ignored on the server.
|
||||
|
||||
@@ -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 pattern string
|
||||
---@return table string[]
|
||||
|
||||
@@ -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 maxDistance? number The max distance to check.
|
||||
---@return { object: number, coords: vector3 }[]
|
||||
|
||||
@@ -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 maxDistance? number The max distance to check.
|
||||
---@return { ped: number, coords: vector3 }[]
|
||||
|
||||
@@ -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 maxDistance? number The max distance to check.
|
||||
---@param includePlayer? boolean Whether or not to include the current player.
|
||||
|
||||
@@ -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 maxDistance? number The max distance to check.
|
||||
---@return { id: number, ped: number, coords: vector3 }[]
|
||||
|
||||
@@ -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 maxDistance? number The max distance to check.
|
||||
---@param includePlayerVehicle? boolean Whether or not to include the player's current vehicle.
|
||||
|
||||
@@ -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_rad = require 'glm'.rad --[[@as fun(n: number): number]]
|
||||
|
||||
|
||||
@@ -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 }
|
||||
local dict = {}
|
||||
|
||||
|
||||
@@ -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 buffer
|
||||
local bufferSize = 0
|
||||
|
||||
@@ -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: param-type-mismatch
|
||||
lib.marker = {}
|
||||
|
||||
|
||||
@@ -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
|
||||
lib.math = math
|
||||
|
||||
|
||||
@@ -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
|
||||
---| 0 DEFAULT
|
||||
---| 1 LOOPING
|
||||
|
||||
@@ -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
|
||||
---@field coords vector3
|
||||
---@field distance number
|
||||
|
||||
@@ -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
|
||||
local printLevel = {
|
||||
error = 1,
|
||||
|
||||
@@ -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 = {}
|
||||
|
||||
local StartShapeTestLosProbe = StartShapeTestLosProbe
|
||||
|
||||
@@ -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.
|
||||
---@param animDict string
|
||||
---@param timeout number? Approximate milliseconds to wait for the dictionary to load. Default is 10000.
|
||||
|
||||
@@ -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.
|
||||
---@param animSet string
|
||||
---@param timeout number? Approximate milliseconds to wait for the clipset to load. Default is 10000.
|
||||
|
||||
@@ -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.
|
||||
---@param audioBank string
|
||||
---@param timeout number?
|
||||
|
||||
@@ -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.
|
||||
---@param model number | string
|
||||
---@param timeout number? Approximate milliseconds to wait for the model to load. Default is 10000.
|
||||
|
||||
@@ -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.
|
||||
---@param ptFxName string
|
||||
---@param timeout number? Approximate milliseconds to wait for the particle effect to load. Default is 10000.
|
||||
|
||||
@@ -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.
|
||||
---@param scaleformName string
|
||||
---@param timeout number? Approximate milliseconds to wait for the scaleform movie to load. Default is 1000.
|
||||
|
||||
@@ -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.
|
||||
---@param textureDict string
|
||||
---@param timeout number? Approximate milliseconds to wait for the dictionary to load. Default is 10000.
|
||||
|
||||
@@ -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
|
||||
---| 1 WRF_REQUEST_BASE_ANIMS
|
||||
---| 2 WRF_REQUEST_COVER_ANIMS
|
||||
|
||||
@@ -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 _require = require
|
||||
|
||||
|
||||
@@ -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
|
||||
---@field name string
|
||||
---@field model string | number
|
||||
|
||||
@@ -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
|
||||
---@generic T : string | number
|
||||
---@param request function
|
||||
|
||||
@@ -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
|
||||
lib.string = string
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
---@class oxtable : tablelib
|
||||
|
||||
@@ -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
|
||||
---@field initialTime number the initial duration of the timer.
|
||||
---@field async? boolean wether the timer should run asynchronously or not
|
||||
|
||||
@@ -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.\
|
||||
---Implements functionality from [this pending pull request](https://github.com/citizenfx/fivem/pull/1210) and may be deprecated.
|
||||
---
|
||||
|
||||
@@ -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.
|
||||
---@generic T
|
||||
---@param cb fun(): T?
|
||||
|
||||
@@ -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'
|
||||
|
||||
---@class ZoneProperties
|
||||
|
||||
10
init.lua
10
init.lua
@@ -1,7 +1,11 @@
|
||||
---@meta
|
||||
---ox_lib <https://github.com/overextended/ox_lib>
|
||||
---Copyright (C) 2021 Linden <https://github.com/thelindat>
|
||||
---LGPL-3.0-or-later <https://www.gnu.org/licenses/lgpl-3.0.en.html>
|
||||
--[[
|
||||
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 not _VERSION:find('5.4') then
|
||||
error('Lua 5.4 must be enabled in the resource manifest!', 2)
|
||||
|
||||
@@ -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)
|
||||
return allow == false and 'deny' or 'allow'
|
||||
end
|
||||
|
||||
8
resource/cache/client.lua
vendored
8
resource/cache/client.lua
vendored
@@ -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
|
||||
cache.playerId = PlayerId()
|
||||
cache.serverId = GetPlayerServerId(cache.playerId)
|
||||
|
||||
@@ -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 = {}
|
||||
|
||||
AddEventHandler('onResourceStop', function(resourceName)
|
||||
|
||||
@@ -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
|
||||
|
||||
---@param commandName string
|
||||
|
||||
@@ -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?
|
||||
local alert = nil
|
||||
local alertId = 0
|
||||
|
||||
@@ -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 value string
|
||||
function lib.setClipboard(value)
|
||||
SendNUIMessage({
|
||||
|
||||
@@ -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 openContextMenu = nil
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
---@class InputDialogRowProps
|
||||
|
||||
@@ -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'
|
||||
|
||||
local keepInput = IsNuiFocusKeepingInput()
|
||||
|
||||
@@ -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 }
|
||||
local registeredMenus = {}
|
||||
---@type MenuProps | nil
|
||||
|
||||
@@ -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 NotificationType 'info' | 'warning' | 'success' | 'error'
|
||||
---@alias IconAnimationType 'spin' | 'spinPulse' | 'spinReverse' | 'pulse' | 'beat' | 'fade' | 'beatFade' | 'bounce' | 'shake'
|
||||
|
||||
@@ -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 DisableControlAction = DisableControlAction
|
||||
local DisablePlayerFiring = DisablePlayerFiring
|
||||
|
||||
@@ -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
|
||||
---@field icon string | {[1]: IconProp, [2]: string};
|
||||
---@field label string
|
||||
|
||||
@@ -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?
|
||||
local skillcheck
|
||||
|
||||
|
||||
@@ -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
|
||||
---@field position? 'right-center' | 'left-center' | 'top-center' | 'bottom-center';
|
||||
---@field icon? string | {[1]: IconProp, [2]: string};
|
||||
|
||||
@@ -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('txAdmin-hideDefaultAnnouncement', 0) == 1 then
|
||||
|
||||
@@ -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 function loadLocaleFile(key)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
---@class VehicleProperties
|
||||
|
||||
@@ -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 props VehicleProperties
|
||||
---@diagnostic disable-next-line: duplicate-set-field
|
||||
|
||||
@@ -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)
|
||||
local resource = GetInvokingResource() or GetCurrentResourceName()
|
||||
|
||||
|
||||
@@ -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)
|
||||
local currentVersion = GetResourceMetadata(resource, 'version', 0)
|
||||
currentVersion = currentVersion and currentVersion:match('%d+%.%d+%.%d+') or 'unknown'
|
||||
|
||||
@@ -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 controlsActive = false
|
||||
local zoneType, step, xCoord, yCoord, zCoord, heading, height, width, length
|
||||
|
||||
@@ -1,40 +1,9 @@
|
||||
--[[
|
||||
-- function
|
||||
local poly = lib.zones.poly({
|
||||
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,
|
||||
})
|
||||
-- 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,
|
||||
})
|
||||
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 formatNumber(num)
|
||||
|
||||
Reference in New Issue
Block a user