SetResourceAmount

Parameters
whichUnit unit

Change amount of this gold mine unit.

amount integer

The new gold amount.

bug

If the final value, after adding a negative amount, will be less than zero, then it will display the correct negative amount, but mining won't yield any gold. If peasant enters a mine with 0 gold, it's destroyed and he stops next to mine. If peasant enters a mine with <0 gold, it's destroyed and he runs back to the castle.

comment

Sets the amount of available gold of a gold mine. The amount can be negative, which is practically the same as 0.

note

See: AddResourceAmount, GetResourceAmount

return type
nothing
Source code
native SetResourceAmount takes unit whichUnit, integer amount returns nothing
Source
unit.j
wc3modding.com
SetResourceAmount