refactor/cron/server/main): Validate event params

This commit is contained in:
Ilias Rbayti
2024-11-14 12:21:24 +01:00
parent 0b2cdf8913
commit 1aae1970a3
+4
View File
@@ -47,5 +47,9 @@ LastTime = GetUnixTimestamp()
Tick()
AddEventHandler("cron:runAt", function(h, m, cb)
assert(type(h) == "number", ("Expected number for h, got %s"):format(type(h)))
assert(type(m) == "number", ("Expected number for m, got %s"):format(type(m)))
assert(type(cb) == "function", ("Expected function for cb, got %s"):format(type(cb)))
RunAt(h, m, cb)
end)