- Joined
- Oct 24, 2012
- Messages
- 6,545
is there a way to get an items lumber cost ?
and i need it to get lumber cost of item so if someone buys item they arent allowed to get in my map then it returns there lumber
Actually, it has an GetItemWoodCost function that takes an item : p. It returns the item's total cost, accounting for the charges on the item.
there is one, in the lib nestharus linked. Its just named differently... If there was a native this whole thread wouldnt exist.ya basically tht muzzel except there is no getlumbercost
call IssueNeutralImmediateOrderById(p,u,id)
private function destroyItems takes nothing returns nothing
local item Item
set Item = GetEnumItem()
call RemoveItem( Item)
set Item = null
endfunction
private function settingLumberCosts takes nothing returns nothing
local integer Loop = 33
local unit u = gg_unit_n01M_0127
local integer maxLumber = 1000000 // 1 mil
local integer itemLumber
local rect r = gg_rct_Delete_Items
loop
exitwhen Loop > 39
call SetPlayerState( Player(11), PLAYER_STATE_RESOURCE_LUMBER, maxLumber)
call AddItemToStock( u, itemIDS[Loop], 1, 1)
call IssueNeutralImmediateOrderById( Player(11), u, itemIDS[Loop])
call RemoveItemFromStock( u, itemIDS[Loop])
set itemLumber = GetPlayerState( Player(11), PLAYER_STATE_RESOURCE_LUMBER)
set lumberCost[Loop] = maxLumber - itemLumber
set Loop = Loop + 1
endloop
call EnumItemsInRect( r, null, function destroyItems)
call ShowUnit( u, false )
set u = null
set r = null
endfunction