Difference between revisions of "API CheckStorageAndUnloadCargo"

From Vendetta Lua
Jump to: navigation, search
(split)
 
Line 1: Line 1:
=== CheckStorageAndUnloadCargo ===
+
{{Function
'''Definition:'''
+
| name        = CheckStorageAndUnloadCargo
CheckStorageAndUnloadCargo({{int itemid, int quantity} ..}, function cb) -> nil
+
| desc        = Unload cargo items and quantities according to the provided table also checks station storage and pops up a dialog if not enough available
<br>
+
| arg1_name    = itemid
'''Description:'''<br>
+
| arg1_type    = number
Unload cargo items and quantities according to the provided table also checks station storage and pops up a dialog if not enough available
+
| arg1_desc    = [[itemid]] of cargo item
<br>
+
| arg2_name    = quantity
'''Arguments:'''<br>
+
| arg2_type    = number
''itemid'' [[itemid]] of cargo item<br>
+
| arg2_desc    = amount of this cargo to unload
''quantity'' amount of this cargo to unload<br>
+
| arg3_name    = cb
''cb'' optional function to call on success
+
| arg3_type    = function
<br>
+
| arg3_desc    = optional function to call on success
'''Example:'''<br>
+
| arg3_opt    = true
 +
| ret1_type    = nil
 +
| notes        = '''Example:'''<br>
 
<source lang="lua">CheckStorageAndUnloadCargo{{itemid=1234, quantity=2}, {itemid=1235, quantity=3}}</source><br>
 
<source lang="lua">CheckStorageAndUnloadCargo{{itemid=1234, quantity=2}, {itemid=1235, quantity=3}}</source><br>
 
unload 2 units of the cargo with the itemid 1234 and 3 with the id 1235
 
unload 2 units of the cargo with the itemid 1234 and 3 with the id 1235
<br>
+
}}

Revision as of 05:50, 18 October 2011

CheckStorageAndUnloadCargo

Definition

CheckStorageAndUnloadCargo( number  itemid,  number  quantity [,  function  cb ]) ->  nil
Description

Unload cargo items and quantities according to the provided table also checks station storage and pops up a dialog if not enough available
Arguments

Type Name Description
number itemid itemid of cargo item
number quantity amount of this cargo to unload
function cb optional function to call on success (optional)
Returns

Type Name Description
nil
Notes

Example:

CheckStorageAndUnloadCargo{{itemid=1234, quantity=2}, {itemid=1235, quantity=3}}

unload 2 units of the cargo with the itemid 1234 and 3 with the id 1235