mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-28 23:01:26 +00:00
hfix
This commit is contained in:
@@ -7,6 +7,8 @@ local CancelledTimeouts = {}
|
||||
---@param cb function
|
||||
---@return number
|
||||
xLib.timeout.setTimeout = function(msec, cb)
|
||||
xLib.verify(cb, "function", true)
|
||||
|
||||
local id <const> = TimeoutCount + 1
|
||||
|
||||
SetTimeout(msec, function()
|
||||
|
||||
@@ -10,13 +10,11 @@ xLib.waitFor = function(conditionFunc, errorMessage, timeoutMs)
|
||||
error("Timeout should be a positive number.")
|
||||
end
|
||||
|
||||
if not ESX.IsFunctionReference(conditionFunc) then
|
||||
error("Condition Function should be a function reference.")
|
||||
end
|
||||
xLib.verify(conditionFunc, "function", true)
|
||||
|
||||
-- since errorMessage is optional, we only validate it if the user provided it.
|
||||
if errorMessage then
|
||||
ESX.AssertType(errorMessage, "string", "errorMessage should be a string.")
|
||||
xLib.verify(errorMessage, "string", true)
|
||||
end
|
||||
|
||||
local invokingResource = GetInvokingResource()
|
||||
|
||||
Reference in New Issue
Block a user