Jump to content

SetUnitRadioFrequency

From CMM Wiki
Return to CMM Command Reference
Environment: Mission Scripting
Function: SetUnitRadioFrequency
Function Description: Sets the radio frequency and modulation mode of an individual unit. The function first verifies that UnitName refers to a valid unit and that Frequency is numeric. It then checks that Modulation is either 0 (AM) or 1 (FM); any other value defaults to AM. If all validations pass, it builds a frequency‑change command via CMM.PrepUnitFrequencyChange and applies it to the unit’s controller.
File Location: cmm.DCSFunctions.lua
Syntax: CMM.SetUnitRadioFrequency( string UnitName , number Frequency , number Modulation )
Return Value:
Parameters: Name Description
UnitNameThe name of the unit whose radio will be configured (e.g., "Uzi11").
FrequencyDesired frequency in MHz (e.g., 305).
Modulation0 for AM, 1 for FM. Any other value defaults to 0.
Example: CMM.SetUnitRadioFrequency("Uzi11",305,0)
Example Description: Demonstrates setting the radio of unit "Uzi11" to 305 MHz with AM modulation.
Related Functions:
Notes: