Xpl command
Jump to navigation
Jump to search
Description
xpl_command(commandref)
xpl_command is used to send a command to X-plane
X-plane uses commandrefs, these may be used to send commands to X-Plane. You can find the list of available commands here.
Return value
This function won't return any value.
Arguments
# | Argument | Type | Description |
---|---|---|---|
1 | commandref | String | Reference to a command from X-plane (see here) |
2 | value | Number | Optional field. Providing it with 1 will send a BEGIN command, Providing it with 0 will send an END command. |
Example
-- Shut down X-plane
xpl_command("sim/operation/quit")
-- Only use the begin and end commands when necessary
function button_pressed()
-- Engage starter motor
xpl_command("sim/engines/engage_starters", 1)
end
function button_released()
-- Disengage starter motor
xpl_command("sim/engines/engage_starters", 0)
end