IsTimer: Difference between revisions

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search
Automatyczna aktualizacja dokumentacji funkcji
 
Complete Lua function catalog
 
Line 30: Line 30:
* Available in both client-side and server-side resource scripts.
* Available in both client-side and server-side resource scripts.


[[Category:Lua Functions]]
[[Category:Shared Functions]]
[[Category:Shared Functions]]
[[Category:Timer Functions]]
[[Category:Timer Functions]]
[[Category:Utility Functions]]
[[Category:Utility Functions]]

Latest revision as of 09:54, 15 August 2026

isTimer

Checks whether a timer identifier still refers to an active timer.

Syntax

bool isTimer(int timerId)

Parameters

Name Type Required Description
timerId int yes The timer identifier to inspect.

Returns

Returns true for an active timer; otherwise returns false.

Examples

Check a timer before cancelling it:

local timer = setTimer(function() end, 5000, 1)
if isTimer(timer) then
    killTimer(timer)
end

Notes

  • Available in both client-side and server-side resource scripts.