From b3b49b1cbd457dc068672ab95986a27dfcd752ef Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Sat, 25 Feb 2023 18:20:14 +1100 Subject: [PATCH] fix: missing and invalid types and parameters --- imports/getNearbyPlayers/client.lua | 2 +- imports/requestStreamedTextureDict/client.lua | 2 +- resource/interface/client/input.lua | 2 +- resource/interface/client/radial.lua | 7 ++++--- resource/vehicleProperties/client.lua | 4 ++-- resource/zoneCreator/client.lua | 3 ++- 6 files changed, 11 insertions(+), 9 deletions(-) diff --git a/imports/getNearbyPlayers/client.lua b/imports/getNearbyPlayers/client.lua index 67d3677..1254697 100644 --- a/imports/getNearbyPlayers/client.lua +++ b/imports/getNearbyPlayers/client.lua @@ -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() diff --git a/imports/requestStreamedTextureDict/client.lua b/imports/requestStreamedTextureDict/client.lua index 66dad57..4b47505 100644 --- a/imports/requestStreamedTextureDict/client.lua +++ b/imports/requestStreamedTextureDict/client.lua @@ -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 diff --git a/resource/interface/client/input.lua b/resource/interface/client/input.lua index 929cfc3..e5c2b4e 100644 --- a/resource/interface/client/input.lua +++ b/resource/interface/client/input.lua @@ -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 diff --git a/resource/interface/client/radial.lua b/resource/interface/client/radial.lua index 5fb83d3..3d65eaa 100644 --- a/resource/interface/client/radial.lua +++ b/resource/interface/client/radial.lua @@ -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 } }) diff --git a/resource/vehicleProperties/client.lua b/resource/vehicleProperties/client.lua index af6031f..8e7e86c 100644 --- a/resource/vehicleProperties/client.lua +++ b/resource/vehicleProperties/client.lua @@ -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 \ No newline at end of file +end diff --git a/resource/zoneCreator/client.lua b/resource/zoneCreator/client.lua index ac6ef3d..aef843b 100644 --- a/resource/zoneCreator/client.lua +++ b/resource/zoneCreator/client.lua @@ -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)