API ConnectAddon

From Vendetta Lua
Jump to navigationJump to search

ConnectAddon

Definition
ConnectAddon( number  portid,  number  itemid [,  function  cb ]) ->  boolean  canconnect
Description
Attaches the addon itemid to the active ship in port portid
Arguments
Type Name Description
number portid portid of the the port
number itemid itemid of the addon
function cb function to call on completion (optional)
Returns
Type Name Description
boolean canconnect returns true if the player is docked and has an active ship otherwise nil
Notes
Example:
<source lang="lua"> -- put the addon 123 into port 2 while the player is docked to a station ConnectAddon(2, 123) -> true </source>