API CheckStorageAndUnloadCargo

From Vendetta Lua
Revision as of 21:56, 25 January 2009 by Chefkoch (Talk | contribs) (split)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

CheckStorageAndUnloadCargo

Definition: CheckStorageAndUnloadCargo({{int itemid, int 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:
itemid itemid of cargo item
quantity amount of this cargo to unload
cb optional function to call on success
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