Skip to content

πŸͺ Store ​

VORP RSG TPZZoo Store

πŸ›’ Buy on zoo-scripts.com

General stores and gunsmiths for VORP, RSG and TPZ, and stores that players own, stock and price themselves.

Install ​

  1. Put the zoo_store folder in resources/[zoo]/.

  2. Open config/config.lua and set Config.Framework to 'vorp', 'rsg' or 'tpz'.

  3. Add this line to server.cfg after your framework (its core and its inventory) and oxmysql:

    ini
    ensure zoo_store
  4. Do not run the framework's own stores at the same counters (vorp_stores, rsg-shops, tpz_stores). They put shopkeepers, blips and prompts in the same places.

  5. RSG and TPZ only. zoo_store writes its items into your framework's item file, so server.cfg must allow it (anywhere before the server finishes starting). Add the line for your framework:

    ini
    add_filesystem_permission zoo_store write rsg-core
    ini
    add_filesystem_permission zoo_store write tpz_inventory
  6. Start the server. On the first start zoo_store makes its database tables and adds its items (the three permits and the tax ledger) where your framework keeps items. The inventory reads its items only when it starts, so restart the server once more before giving them out. The console says so when it added any.

  7. Copy the pictures in img/items/ (permit_general.png, permit_gunsmith.png, permit_trading.png, tax_ledger.png) into your inventory's picture folder: vorp_inventory/html/img/items/, rsg-inventory/html/images/ or tpz_inventory/html/img/items/.

Creating stores ​

There are three kinds of store.

The server's own stores ​

They are written in the stores file of your framework: config/shops_vorp.lua, config/shops_rsg.lua or config/shops_tpz.lua. To add one, copy a store in that file and change:

  • id: a unique name
  • name
  • type: general or gunsmith
  • coords: where players open it
  • npc: its shopkeeper and map icon
  • goods

Restart zoo_store after editing.

Selling to the server's stores ​

A server store also buys from players. Every goods line can carry a sell price, the dollars the store pays for one:

lua
{ item = 'Yarrow',    label = 'Yarrow',    price = 0.25,  gold = 0, sell = 0.10 },   -- sold at 0.25, bought back at 0.10
{ item = 'deer_pelt', label = 'Deer Pelt', price = false, gold = 0, sell = 1.50 },   -- only bought, never sold
{ weapon = 'WEAPON_REVOLVER_CATTLEMAN', label = 'Cattleman Revolver', price = 50, gold = 0, sell = 20 },
  • A line without sell (or with sell = 0) is not bought. price = false keeps a line off the shelves: the store only buys it.
  • The store's page gets a Sell tab that works like buying: the player's own goods the store buys are the cards, he drags them into a basket (or double-clicks them, or presses +), sets how many, and presses Sell. He is paid in cash at once, and the basket is stamped Sold.
  • Items and weapons. A weapon is bought whole, with whatever is fitted on it, and is gone for good. A weapon in the player's hands is not bought until he puts it away. Spoiled or broken goods are not bought.
  • The server takes every price from the config, never from the page, and pays only for goods that really left the satchel.
  • A store never buys goods for as much as a server store sells them for in dollars: such a line is not bought, and the server console names it so its sell can be lowered.
  • Out of the box every line has a sell price: items at half their price, weapons at 40%.
  • Config.SellToStores = false in config/config.lua turns selling off for every server store.

A player's store, with a permit ​

  1. Give the player a permit: permit_general (general store), permit_gunsmith (gunsmith) or permit_trading (trading post, sells everything).
  2. The player uses the permit from the inventory. A ring appears on the ground in front of them.
  3. They walk the ring to the spot and press Enter to place the store (X cancels).
  4. They name the store, and may give their own Discord webhook to get its messages.
  5. The store is theirs: hold G at it to open it, stock it, price it and run it.

A character may own Config.MaxPerCharacter stores (1 out of the box).

A store for sale, placed by an admin ​

  1. An admin types zoostore_sale in game. A ring appears on the ground in front of them.
  2. They walk the ring to the spot and press Enter to place it.
  3. They pick its type (general store, gunsmith, trading post), its price, and its tax in percent (empty: the tax of every store).
  4. It shows on the map as "Store for sale", with its price over its prompt.
  5. A player holds G at it, reads its type, price and tax, names it (and may give a Discord webhook) and buys it with cash. It is then their store, like any other.

An admin who holds G at a store for sale also sees Take off sale, which removes it (a second click confirms).

Who is an admin ​

An admin is a player whose group in the framework is one of Config.AdminGroups in config/config.lua (admin and god out of the box). On VORP that is the account's or the character's group, on RSG a permission rank, and on TPZ the player's group.

Zoo Scripts. Commercial resources, redistribution or resale is not permitted.