mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 06:56:03 +01:00
fix: missing and invalid types and parameters
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
---@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.
|
||||||
---@return table players
|
---@return table players
|
||||||
function lib.getNearbyPlayers(coords, maxDistance, includePlayer)
|
function lib.getNearbyPlayers(coords, maxDistance, includePlayer)
|
||||||
local players = GetActivePlayers()
|
local players = GetActivePlayers()
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ function lib.requestStreamedTextureDict(textureDict, timeout)
|
|||||||
error(("expected textureDict to have type 'string' (received %s)"):format(type(textureDict)))
|
error(("expected textureDict to have type 'string' (received %s)"):format(type(textureDict)))
|
||||||
end
|
end
|
||||||
|
|
||||||
RequestStreamedTextureDict(textureDict)
|
RequestStreamedTextureDict(textureDict, false)
|
||||||
|
|
||||||
if coroutine.running() then
|
if coroutine.running() then
|
||||||
timeout = tonumber(timeout) or 500
|
timeout = tonumber(timeout) or 500
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ local input
|
|||||||
|
|
||||||
---@param heading string
|
---@param heading string
|
||||||
---@param rows string[] | InputDialogRowProps[]
|
---@param rows string[] | InputDialogRowProps[]
|
||||||
---@param options InputDialogOptionsProps[]
|
---@param options InputDialogOptionsProps[]?
|
||||||
---@return string[] | number[] | boolean[] | nil
|
---@return string[] | number[] | boolean[] | nil
|
||||||
function lib.inputDialog(heading, rows, options)
|
function lib.inputDialog(heading, rows, options)
|
||||||
if input then return end
|
if input then return end
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
---@field label string
|
---@field label string
|
||||||
---@field menu? string
|
---@field menu? string
|
||||||
---@field onSelect? function
|
---@field onSelect? function
|
||||||
|
---@field [string] any
|
||||||
|
|
||||||
---@class RadialMenuProps
|
---@class RadialMenuProps
|
||||||
---@field id string
|
---@field id string
|
||||||
@@ -23,8 +24,8 @@ local menuHistory = {}
|
|||||||
---@type RadialMenuProps?
|
---@type RadialMenuProps?
|
||||||
local currentRadial = nil
|
local currentRadial = nil
|
||||||
|
|
||||||
---Open a registered radial submenu with the given id.
|
---Open a the global radial menu or a registered radial submenu with the given id.
|
||||||
---@param id string
|
---@param id string?
|
||||||
local function showRadial(id)
|
local function showRadial(id)
|
||||||
local radial = id and menus[id]
|
local radial = id and menus[id]
|
||||||
|
|
||||||
@@ -48,7 +49,7 @@ local function showRadial(id)
|
|||||||
SendNUIMessage({
|
SendNUIMessage({
|
||||||
action = 'openRadialMenu',
|
action = 'openRadialMenu',
|
||||||
data = {
|
data = {
|
||||||
items = radial?.items or menuItems,
|
items = radial and radial.items or menuItems,
|
||||||
sub = radial and true or nil
|
sub = radial and true or nil
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -371,7 +371,7 @@ function lib.setVehicleProperties(vehicle, props)
|
|||||||
if state == 1 then
|
if state == 1 then
|
||||||
SetVehicleTyreBurst(vehicle, tyre, false, 1000.0)
|
SetVehicleTyreBurst(vehicle, tyre, false, 1000.0)
|
||||||
else
|
else
|
||||||
SetVehicleTyreBurst(vehicle, tyre, true)
|
SetVehicleTyreBurst(vehicle, tyre, true, 1000.0)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ local function closeCreator(cancel)
|
|||||||
points[#points + 1] = vec(xCoord, yCoord)
|
points[#points + 1] = vec(xCoord, yCoord)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---@type string[]
|
||||||
local input = lib.inputDialog(('Name your %s Zone'):format(firstToUpper(zoneType)), {
|
local input = lib.inputDialog(('Name your %s Zone'):format(firstToUpper(zoneType)), {
|
||||||
{ type = 'input', label = 'Name', placeholder = 'none' },
|
{ type = 'input', label = 'Name', placeholder = 'none' },
|
||||||
{ type = 'select', label = 'Format', default = format, options = {
|
{ type = 'select', label = 'Format', default = format, options = {
|
||||||
@@ -229,7 +230,7 @@ local function startCreator(arg, useLast)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if controlsActive then
|
if controlsActive then
|
||||||
DisableAllControlActions()
|
DisableAllControlActions(0)
|
||||||
EnableControlAction(0, controls['INPUT_LOOK_LR'], true)
|
EnableControlAction(0, controls['INPUT_LOOK_LR'], true)
|
||||||
EnableControlAction(0, controls['INPUT_LOOK_UD'], true)
|
EnableControlAction(0, controls['INPUT_LOOK_UD'], true)
|
||||||
EnableControlAction(0, controls['INPUT_MP_TEXT_CHAT_ALL'], true)
|
EnableControlAction(0, controls['INPUT_MP_TEXT_CHAT_ALL'], true)
|
||||||
|
|||||||
Reference in New Issue
Block a user