SetPlayerItemPrice
Gives one of the player’s tagged items a price of its own - and puts it up for sale.
price is in Groschen, 0 to 1,000,000, in place of the class’s own: the game’s item panel shows it, and a shop that buys the item’s
kind pays its sell factor of it (CreateShop). A tagged item without a price of its own is not for sale at all (a letter, a
contract) - giving it one is how a mode lets players sell it. nil gives the class’s back and takes it off sale. The price belongs
to the item: it travels with it and GetPlayerInventory lists it as price. A piece bought from a shop’s tagged row
(SetShopTaggedItem) comes with the price it cost.
Syntax
Section titled “Syntax”SetPlayerItemPrice(pid, id, price)| Parameter | Type | |
|---|---|---|
pid |
number | the player |
id |
string | the tagged item’s id |
price |
number | nil | Groschen; nil = the class’s own (not for sale) |
Returns
Section titled “Returns”boolean - false when the player holds no item with that id, or for a price outside 0..1,000,000
Example
Section titled “Example”-- the tournament's prize: a sword of its own name, worth a fortune to a merchantGivePlayerTaggedItem(winner, "longSwordDuel", "prize-" .. year, "Champion's blade", "Won at the tournament of " .. year .. ".")SetPlayerItemPrice(winner, "prize-" .. year, 2500)See also
Section titled “See also”SetPlayerItemWeight · SetPlayerItemModel · SetShopTaggedItem · GivePlayerTaggedItem · GetPlayerInventory · the Items and inventory group of the index
