GetAirbaseByID
Appearance
| Environment: | Mission Scripting | |
|---|---|---|
| Function: | GetAirbaseByID | |
| Function Description: | Retrieves an Airbase object by its numeric ID. The function checks that the supplied ID is a number, then iterates through all airbases returned by world.getAirbases(). If a match is found, it logs a message and returns the corresponding Airbase object; otherwise it logs that no match was found and returns nil. | |
| File Location: | cmm.DCSFunctions.lua | |
| Syntax: | CMM.GetAirbaseByID( number ID ) | |
| Return Value: | table or nil | |
| Parameters: | Name | Description |
| ID | The numeric identifier of the airbase to locate (e.g., 42). | |
| Example: | local ab = CMM.GetAirbaseByID(42); env.info("Found: "..tostring(ab)) | |
| Example Description: | Demonstrates looking up the airbase with ID 42 and logging whether it was found. | |
| Related Functions: | ||
| Notes: | ||