OpenShop
Opens the shop screen on a player.
The screen comes up with the Buy tab (and the Sell tab when the shop buys). With vendor - an NPC
actor - the screen closes when the player walks 4 m from it or it dies; without one it stays until CloseShop or
the player’s Esc. A shop already open on the player is replaced. An actor with a shop of its own opens
it on the use key without any of this.
Syntax
Section titled “Syntax”OpenShop(pid, shop [, vendor])| Parameter | Type | |
|---|---|---|
pid |
number | the player |
shop |
number | the shop |
vendor |
number | the actor the shop is on; nil = none (optional) |
Returns
Section titled “Returns”boolean - false when the player is not in the world or the shop does not exist
Example
Section titled “Example”-- /shop opens the town store from anywherefunction OnPlayerCommandText(pid, cmd, args) if cmd == "shop" then OpenShop(pid, store) return true endendSee also
Section titled “See also”CloseShop · GetPlayerShop · SetActorShop · the Shops and vendors group of the index
