# SimConnect_AIReleaseControl The **SimConnect\_AIReleaseControl** function is used to clear the AI control of a simulated object, typically an aircraft, in order for it to be controlled by a SimConnect client.   ##### Syntax ``` cpp HRESULT SimConnect_AIReleaseControl( HANDLE hSimConnect, SIMCONNECT_OBJECT_ID ObjectID, SIMCONNECT_DATA_REQUEST_ID RequestID ); ```   ##### Parameters {{< table-wrapper >}} | Parameter | Description | Type | |---------------|------------------------------------------|---------| | *hSimConnect* | Handle to a SimConnect object. | Integer | | *ObjectID* | Specifies the server defined object ID. | Integer | | *RequestID* | Specifies the client defined request ID. | Integer | {{< /table-wrapper >}}   ##### Return Values The function returns an **HRESULT**. Possible values include, but are not limited to, those in the following table. {{< table-wrapper >}} | Return value | Description | |--------------|-------------------------| | S\_OK | The function succeeded. | | E\_FAIL | The function failed. | {{< /table-wrapper >}}   ##### Remarks This function should be used to transfer the control of an aircraft, or other object, from the AI system to the SimConnect client. If this is not done the AI system and client may fight each other with unpredictable results. To prevent the simulation engine from updating the latitude, longitude, altitude and attitude of an aircraft, refer to the range of `FREEZE_*` [Event ID](../../../key-events/key-events/)s.   The object ID can be obtained in a number of ways, refer to the [SimConnect\_RequestDataOnSimObjectType](../events-and-data/simconnect-requestdataonsimobjecttype/) call, and also the use of the [SIMCONNECT\_RECV\_ASSIGNED\_OBJECT\_ID](../structures-and-enumerations/simconnect-recv-assigned-object-id/) structure.