server
Options and examples
### Interval Function for Executing Actions at Specified Time Intervals ###
The `QT.SetInterval` function allows you to execute an action at a set time interval (in seconds, which you configure).
Each interval is assigned a unique ID for easy identification, allowing you to stop it later if needed.
## Function Parameters: ##
- id: A unique identifier (string or number) used to index the interval. This is useful for tracking or stopping the interval later.
- time: The time interval in milliseconds. You can convert this time based on your needs.
## Example Usage: ##
QT.SetInterval("motel_days_remover", 60000, function()
local hour, minute = TimeFunction()
if hour == 23 and minute == 0 then
for k, v in pairs(Motels) do
RemoveDay(v["doors"], k)
end
end
end)
-- To stop the interval:
QT.ClearInterval("motel_days_remover") -- Stops the interval with the unique idLast updated