Search the Commands

Home  All  a  b  c  d  e  f  g  h  i  j  k  l  m  n  o  p  q  r  s  t  u  v  w  x  y  z 

Details for command npcshopattach:
* npcshopattach "Shop name"{,<flag>};
This command will attach the current script to the given npc shop.
When a script is attached to a shop, the events "OnBuyItem" and "OnSellItem"
of your script will be executed whenever a player buys/sells from the shop.
Additionally, the arrays @bought_nameid[], @bought_quantity[] or @sold_nameid[]
and @sold_quantity[] will be filled up with the items and quantities

The optional parameter specifies whether to attach ("1") or detach ("0") from
the shop (the default is to attach). Note that detaching will detach any npc
attached to the shop, even if it's from another script, while attaching will
override any other script that may be already attached.

The function returns 0 if the shop was not found, 1 otherwise.

Valid XHTML 1.0 Strict Valid CSS!