mirror of
https://github.com/akaAgar/the-universal-mission-for-dcs-world.git
synced 2025-11-25 19:31:01 +00:00
Added DCSEx.unitCallsignMaker.getNextGroupCallSign(callsign)
This commit is contained in:
parent
1b1136c0d3
commit
1f5993c87f
@ -198,6 +198,28 @@ do
|
|||||||
return callsignTable
|
return callsignTable
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function DCSEx.unitCallsignMaker.getNextGroupCallSign(callsign)
|
||||||
|
if not callsign then return nil end
|
||||||
|
local callsignName = callsign:sub(1, #callsign - 2):lower()
|
||||||
|
local callsignGroupNumber = tonumber(callsign:sub(#callsign - 2, #callsign - 1))
|
||||||
|
local callsignUnitNumber = tonumber(callsign:sub(#callsign - 1, #callsign))
|
||||||
|
|
||||||
|
for csType,_ in pairs(CALLSIGNS) do
|
||||||
|
for csNameIndex,_ in pairs(CALLSIGNS[csType]) do
|
||||||
|
if CALLSIGNS[csType][csNameIndex]:lower() == callsignName then
|
||||||
|
return {
|
||||||
|
[1] = csNameIndex,
|
||||||
|
[2] = callsignGroupNumber,
|
||||||
|
[3] = callsignUnitNumber,
|
||||||
|
["name"] = CALLSIGNS[csType][csNameIndex]..tostring(callsignGroupNumber),
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
local missionGroups = DCSEx.envMission.getGroups()
|
local missionGroups = DCSEx.envMission.getGroups()
|
||||||
for _,g in ipairs(missionGroups) do
|
for _,g in ipairs(missionGroups) do
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user