fix: missing and invalid types and parameters

This commit is contained in:
Linden
2023-02-25 18:20:14 +11:00
parent b779ea7c3b
commit b3b49b1cbd
6 changed files with 11 additions and 9 deletions

View File

@@ -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()

View File

@@ -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

View File

@@ -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

View File

@@ -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
} }
}) })

View File

@@ -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

View File

@@ -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)