Exclusive Aircraft Access
The following routines require exclusive access to the airplane APIs. Only one plugin may have this access at a time.
XPLMPlanesAvailable_f
callback
Your airplanes available callback is called when another plugin gives up access to the multiplayer planes. Use this to wait for access to multiplayer.
function my_PlanesAvailable_callback(
inRefcon -- any Lua var/table
)
-- your code here
end
XPLMAcquirePlanes
function
XPLMAcquirePlanes grants your plugin exclusive access to the aircraft. It returns true if you gain access, false if you do not.
inAircraft - pass in an array of pointers to strings specifying the planes you want loaded. For any plane index you do not want loaded, pass a 0-length string. Other strings should be full paths with the .acf extension. NULL terminates this array, or pass NULL if there are no planes you want loaded.
Aircraft paths for this API are full, not relative aircraft paths.
If you pass in a callback and do not receive access to the planes your callback will be called when the airplanes are available. If you do receive airplane access, your callback will not be called.
-- returns boolean -> assign to local/var
local my_result = XPLMAcquirePlanes(
inAircraft, -- char const
inCallback, -- see XPLMPlanesAvailable_f
inRefcon -- any Lua var/table
)
See associated types:
XPLMReleasePlanes
function
Call this function to release access to the planes. Note that if you are disabled, access to planes is released for you and you must reacquire it.
XPLMReleasePlanes(
)
XPLMSetActiveAircraftCount
function
This routine sets the number of active planes. If you pass in a number higher than the total number of planes availables, only the total number of planes available is actually used.
XPLMSetActiveAircraftCount(
inCount -- int
)
XPLMSetAircraftModel
function
This routine loads an aircraft model. It may only be called if you have exclusive access to the airplane APIs. Pass in the path of the model with the .acf extension. The index is zero based, but you may not pass in 0 (use XPLMSetUsersAircraft to load the user's aircracft).
This API takes a full aircraft path.
XPLMSetAircraftModel(
inIndex, -- int
inAircraftPath -- string
)
XPLMDisableAIForPlane
function
This routine turns off X-Plane's AI for a given plane. The plane will continue to draw and be a real plane in X-Plane, but will not move itself.
XPLMDisableAIForPlane(
inPlaneIndex -- int
)