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