Difference between revisions of "DCS func removeFunction"

From DCS World Wiki - Hoggitworld.com
m (1 revision imported)
 
 
Line 54: Line 54:
 
}}
 
}}
 
[[Category:Singleton Functions|removeFunction]]
 
[[Category:Singleton Functions|removeFunction]]
 +
[[Category:Game Patch 1.2.0|removeFunction]]

Latest revision as of 06:44, 17 March 2022

Scripting Root

Envrioment: Mission Scripting
Function: removeFunction Added with: 1.2.0
Member Of: timer
Syntax: function timer.removeFunction(number functionId )
Description: Removes a scheduled function as defined by the functionId from executing. Essentially will "destroy" the function.


Return Value: function
Return Example: none
Examples: The following will run a function named "main" 120 seconds from one the code would run.
 local id = timer.scheduleFunction(main, {}, timer.getTime() + 120)

If further down in the code it was decided to stop main() from running it may look like this.

 if abort == true then  
   timer.removeFunction(id)
 end
Related Functions: timer Functions: getTime, getAbsTime,getTime0, scheduleFunction, removeFunction, setFunctionTime
Notes: