Difference between revisions of "API CheckStorageAndUnloadCargo"
From Vendetta Lua
(split) |
|||
Line 1: | Line 1: | ||
− | + | {{Function | |
− | + | | name = CheckStorageAndUnloadCargo | |
− | + | | desc = Unload cargo items and quantities according to the provided table also checks station storage and pops up a dialog if not enough available | |
− | + | | arg1_name = itemid | |
− | + | | 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 |
− | + | | arg2_name = quantity | |
− | + | | arg2_type = number | |
− | + | | arg2_desc = amount of this cargo to unload | |
− | + | | arg3_name = cb | |
− | + | | arg3_type = function | |
− | + | | 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 | ||
− | + | }} |
Revision as of 05:50, 18 October 2011
CheckStorageAndUnloadCargo
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) |
Type | Name | Description |
---|---|---|
nil |
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