OnPlayerOpenShop
A shop screen is about to open on a player - return false to keep it closed.
The use key on a vendor (after OnPlayerInteractActor) or OpenShop is opening the shop on the player. Return
false and nothing opens - say why with SendClientMessage. vendor is the actor the shop is on, nil for a shop
opened without one.
Syntax
Section titled “Syntax”function OnPlayerOpenShop(pid, shop, vendor) -- ...end| Parameter | Type | |
|---|---|---|
pid |
number | the player |
shop |
number | the shop |
vendor |
number | nil | the vendor actor; nil = none |
Returns
Section titled “Returns”false keeps the screen closed; anything else (or nothing) opens it
Example
Section titled “Example”-- the market closes at nightfunction OnPlayerOpenShop(pid, shop, vendor) local hour = GetWorldTime() if vendor and (hour < 6 or hour >= 20) then SendClientMessage(pid, COLOR_RED, "The stall is closed until the morning.") return false endendSee also
Section titled “See also”OnPlayerCloseShop · OpenShop · CreateVendor · the Shops and vendors group of the index
