API CheckStorageAndUnloadCargo

From Vendetta Lua
Revision as of 05:50, 18 October 2011 by Draugath (talk | contribs)
Jump to navigationJump to search

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:
<source lang="lua">CheckStorageAndUnloadCargo{{itemid=1234, quantity=2}, {itemid=1235, quantity=3}}</source>
unload 2 units of the cargo with the itemid 1234 and 3 with the id 1235