Difference between revisions of "DCS func getAirbases"
From DCS World Wiki - Hoggitworld.com
m (1 revision imported) |
|||
(One intermediate revision by the same user not shown) | |||
Line 41: | Line 41: | ||
|optType2= | |optType2= | ||
− | |examples= | + | |examples= The following iterates the returned airbases via world.getAirbases() and stores callsign, id, and other useful information in another table. |
+ | |||
+ | local base = world.getAirbases() | ||
+ | local myBaseTbl = {} | ||
+ | for i = 1, #base do | ||
+ | local info = {} | ||
+ | info.desc = Airbase.getDesc(base[i]) | ||
+ | info.callsign = Airbase.getCallsign(base[i]) | ||
+ | info.id = Airbase.getID(base[i]) | ||
+ | info.cat = Airbase.getCategory(base[i]) | ||
+ | info.point = Airbase.getPoint(base[i]) | ||
+ | if Airbase.getUnit(base[i]) then | ||
+ | info.unitId = Airbase.getUnit(base[i]):getID() | ||
+ | end | ||
+ | |||
+ | myBaseTbl[info.callsign] = info | ||
+ | end | ||
Line 53: | Line 69: | ||
}} | }} | ||
[[Category:Singleton Functions|getAirbases]] | [[Category:Singleton Functions|getAirbases]] | ||
+ | [[Category:Game Patch 1.2.4|getAirbases]] |