Usage
This guide explains how to use the script as admin, owner, and customer.
Admin workflow
1. Create a shop
Command:
/createshop
Steps:
open the admin UI
enter:
shop name
type (
regular,gun,it, or custom type from config)buy price (shop purchase price)
stand at desired locations and click:
Set NPC hereSet Truck Spawn hereSet Truck Return here
click
Create Shop
2. Edit existing shops
Command:
/checkshops
You can update:
NPC location
truck spawn location
truck return location
Player workflow (customer)
go to a shop NPC
open store via target interaction (
Open store)add items to cart
buy items (
Buy)
Notes:
purchases use player cash
the shop must have stock for each item
Owner workflow
1. Buy a shop
At NPC, select Buy Shop.
Conditions:
shop has no owner
player has enough bank money for buy price
Purchase effect:
owner is set to player
balance is reset to 0
stock is initialized to 0 for all items of that shop type
2. Company balance
Owner actions:
Deposit(moves money from owner bank to company balance)Withdraw(moves money from company balance to owner bank)
Profit:
part of each sale is added to company balance (
Config.PercentageToShop)
3. Item pricing
Owner can change item prices.
Restriction:
price must stay inside limits defined by
Config.PriceChangeLimitlimits are calculated from item
buyPrice
4. Stock orders and delivery
Steps:
owner creates stock order from Owner UI (
Order)cost is deducted from company balance
delivery is created (
to_pickup)delivery vehicle spawns at
truckSpawngo to supplier location
at marker press
E(while inside delivery vehicle) to pickupstage changes to
to_returnreturn to
truckReturnat marker press
E(inside delivery vehicle) to completestock is added to shop
Important:
only one active delivery per shop is allowed
without stock, customers cannot buy items
5. Selling a shop
Sell to state:
selling to server returns 50% of buy price to owner
Sell to player:
endpoint exists, but player-to-player sale is currently not implemented on server
Commands
/createshop- admin create shop UI/checkshops- admin edit existing shops
Developer notes
DB tables:
player_shopsplayer_shop_deliveries
server callback for owner data:
playerShops:getShopData
important server events:
playerShops:buyShopplayerShops:checkoutplayerShops:orderStockplayerShops:deliveryPickupplayerShops:deliveryReturnplayerShops:setItemPriceplayerShops:depositplayerShops:withdraw
Last updated