CougarFFW04 Posted February 13, 2024 Posted February 13, 2024 Hi eveyone, Instead of switching to coallition with the coalition values like if Group.getByName(flight):getCoalition() == 1 then... I would like to test the coalition side ("RED" which is same as 1 for exemple) but can't find the right syntax.. Anybody ? 1
Wrecking Crew Posted February 13, 2024 Posted February 13, 2024 Perhaps this will help -- --- MS: code.Create & Load Client Tables aircraftClientBlueNames = {} aircraftClientRedNames = {} do local function contains(tbl, val) for _,v in ipairs(tbl) do if v == val then return true end end return false end for uName, uData in pairs(mist.DBs.humansByName) do if(contains({'red'}, uData.coalition)) then if not(contains(aircraftClientRedNames, uName)) then table.insert(aircraftClientRedNames, uName) end end if(contains({'blue'}, uData.coalition)) then if not(contains(aircraftClientBlueNames, uName)) then table.insert(aircraftClientBlueNames, uName) end end end end Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site.
Solution Zyll Posted February 14, 2024 Solution Posted February 14, 2024 You can reference the enums, so in this case in place of doing a comparison to 1, use coalition.side.RED. For more enums you can use, reference hoggitworld: https://wiki.hoggitworld.com/index.php?title=Special%3ASearch&search=enum&go=Go
CougarFFW04 Posted February 14, 2024 Author Posted February 14, 2024 Hi Guys, thanks for your suggestion. @Zyll : exactly what I was looking for. 1
Recommended Posts