GetCallsignTable
Appearance
| Environment: | Mission Scripting | |
|---|---|---|
| Function: | GetCallsignTable | |
| Function Description: | Parses an aircraft callsign string and returns a table containing the numeric ID of the base callsign, the first digit found in the name, the trailing digit (if any), and the original name. The function uses a predefined mapping (CALLSIGN) from call‑name prefixes to their corresponding IDs. It extracts the alphabetic prefix with string.match, looks up its ID, then pulls the first numeric character and the final numeric character from the full callsign. | |
| File Location: | cmm.DCSFunctions.lua | |
| Syntax: | CMM.GetCallsignTable( string UnitName ) | |
| Return Value: | table or nil | |
| Parameters: | Name | Description |
| UnitName | The full aircraft callsign (e.g., "Uzi61" or "Magic12"). | |
| Example: | local info = CMM.GetCallsignTable("Uzi61"); env.info(tostring(info[1]) .. "," .. tostring(info[2]) .. "," .. tostring(info[3])) | |
| Example Description: | Demonstrates extracting the callsign ID and digits from "Uzi61" and logging them. | |
| Related Functions: | ||
| Notes: | ||