Difference between revisions of "API ConnectAddon"

From Vendetta Lua
Jump to: navigation, search
(split)
 
 
Line 1: Line 1:
=== ConnectAddon ===
+
{{Function
'''Definition:'''<br>
+
| name        = ConnectAddon
ConnectAddon(int portid, int itemid, function cb) -> bool canconnect
+
| desc        = Attaches the addon ''itemid'' to the active ship in port ''portid''
<br>
+
| arg1_name    = portid
'''Description:'''<br>
+
| arg1_type    = number
Attaches the addon ''itemid'' to the active ship in port ''portid''
+
| arg1_desc    = [[portid]] of the the port
<br>
+
| arg1_opt    =
'''Arguments:'''<br>
+
| arg2_name    = itemid
''portid'' [[portid]] of the the port<br>
+
| arg2_type    = number
''itemid'' itemid of the addon<br>
+
| arg2_desc    = itemid of the addon
''cb'' function to call on completition (optional)
+
| arg2_opt    =
<br>
+
| arg3_name    = cb
'''Returns:'''<br>
+
| arg3_type    = function
''canconnect'' returns true if the player is docked and has an active ship otherwise nil
+
| arg3_desc    = function to call on completion
<br>
+
| arg3_opt    = true
'''Example:'''<br>
+
| ret1_name    = canconnect
 +
| ret1_type    = boolean
 +
| ret1_desc    = returns true if the player is docked and has an active ship otherwise nil
 +
| notes        = '''Example:'''<br>
 
<source lang="lua">
 
<source lang="lua">
 
-- put the addon 123 into port 2 while the player is docked to a station
 
-- put the addon 123 into port 2 while the player is docked to a station
 
ConnectAddon(2, 123) -> true
 
ConnectAddon(2, 123) -> true
 
</source>
 
</source>
 +
}}

Latest revision as of 04:01, 19 October 2011

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:

-- put the addon 123 into port 2 while the player is docked to a station
ConnectAddon(2, 123) -> true