Jump to content

coalition.side


Go to solution Solved by Zyll,

Recommended Posts

Posted

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 ?

  • Like 1
Posted

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...