NOTE
Deprecated. Use fsVarsAVarSet instead.

The fsVarsAircraftVarSet function can be used to set the value of a specific SimVar.

 

Syntax
FsVarError fsVarsAircraftVarSet(
    FsSimVarId simvarId,
    FsUnitId unitId,
    FsVarParamArray param,
    double value
);

 

Parameters
ParametersDescription
simvarIdThe ID of a simvar (found using fsVarsGetAircraftVarId).
unitIdThe ID of an unit (found using fsVarsGetUnitId).
paramThe parameter which might be mandatory to access the simvar (in case of an indexed simvar for instance). Elements in param can be FsCrc, String or index.
valueThe new value of the simvar.

 

Return Values

The function returns a FsVarError, 0 means there is no error.

 

Example
FsUnitId unitId = fsVarsGetUnitId("DEGREES");
FsSimVarId simvarId = fsVarsGetAircraftVarId("ATTITUDE INDICATOR PITCH DEGREES");
FsVarParamArray param = FsCreateParamArray("i", 0);
double newValue = 123;
if (fsVarsAircraftVarSet(simvarId, unitId, param, newValue) == FS_VAR_ERROR_NONE)
{
    // valid
}
else
{
    // error
}