diff --git a/lua/entities/gmod_wire_expression2/core/timer.lua b/lua/entities/gmod_wire_expression2/core/timer.lua index ed042a72ef..49781bb96a 100644 --- a/lua/entities/gmod_wire_expression2/core/timer.lua +++ b/lua/entities/gmod_wire_expression2/core/timer.lua @@ -104,11 +104,11 @@ local function luaTimerCreate(self, name, delay, repetitions, callback) } timer.Create(internalName, delay, repetitions, function() - ent:Execute(callback) - if timer.RepsLeft(internalName) == 0 then luaTimers[entIndex][name] = nil end + + ent:Execute(callback) end) end @@ -238,6 +238,9 @@ e2function void timer(string name, number delay, function callback) end __e2setcost(5) +e2function void timerStop(string rv1) = e2function void stoptimer(string rv1) +e2function void timerRemove(string rv1) = e2function void stoptimer(string rv1) + e2function void timerSetDelay(string name, number delay) if not luaTimerExists(self, name) then return self:throw("Timer with name " .. name .. " does not exist", nil) diff --git a/lua/wire/client/e2descriptions.lua b/lua/wire/client/e2descriptions.lua index 79d23fdca4..eee5b57f2b 100644 --- a/lua/wire/client/e2descriptions.lua +++ b/lua/wire/client/e2descriptions.lua @@ -1002,6 +1002,8 @@ E2Helper.Descriptions["runOnTick(n)"] = "DEPRECATED. Use 'event tick()' instead! E2Helper.Descriptions["timer(sn)"] = "DEPRECATED. Use 'timer(sf)' (lambda timer) instead! Sets a one-time timer with entered name and delay in milliseconds" E2Helper.Descriptions["stoptimer(s)"] = "Stops a timer, can stop interval with stoptimer(\"interval\")" E2Helper.Descriptions["stopAllTimers()"] = "Stops all timers" +E2Helper.Descriptions["timerStop(s)"] = "Alias of stoptimer(s). " .. E2Helper.Descriptions["stoptimer(s)"] +E2Helper.Descriptions["timerRemove(s)"] = "Alias of stoptimer(). " .. E2Helper.Descriptions["stoptimer(s)"] E2Helper.Descriptions["timerSetDelay(sn)"] = "Sets the delay of the timer with the name S to N seconds" E2Helper.Descriptions["timerSetReps(sn)"] = "Sets the number of repetitions of the timer with the name S to N" E2Helper.Descriptions["timerAdjust(snn)"] = "Sets the delay and repetitions of the timer with the name S to N seconds and N repetitions"