API CheckStorageAndUnloadCargo: Difference between revisions

From Vendetta Lua
Jump to navigationJump to search
No edit summary
No edit summary
Line 3: Line 3:
| desc        = Unload cargo items and quantities according to the provided table also checks station storage and pops up a dialog if not enough available
| 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_type    = table
| arg1_type    = table
| arg1_desc    = {{((}}number itemid, number quantity} ..}<br>
| arg1_desc    = <nowiki>{{number itemid, number quantity} ..}<nowiki><br>
''itemid'' = [[itemid]] of cargo item<br>
''itemid'' = [[itemid]] of cargo item<br>
''quantity'' = amount of this cargo to unload
''quantity'' = amount of this cargo to unload

Revision as of 06:08, 18 October 2011

{{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_type = table | arg1_desc = <nowiki>{{number itemid, number quantity} ..}<nowiki>
itemid = itemid of cargo item
quantity = amount of this cargo to unload | arg2_name = cb | arg2_type = function | arg2_desc = optional function to call on success | arg2_opt = true | ret1_type = 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 }}