Skip to content

Events & commands ​

Server events ​

server

Local server events (AddEventHandler), fired after np_shops did the work, with one payload table. Use them for logs, statistics or follow-up actions. None of them is a net event, so clients can't fake them.

Event Payload Fired when
np_shops:server:ready { shops } np_shops started. shops is the number of shops. Fired again after every restart
np_shops:server:purchased { source, identifier, shopId, brand, items, total, method, ref, receipt } A purchase was paid and handed over (financing too). Same fields as the afterBuy hook: items = { { name, count, price } } are the lines handed over, ref the payment reference, receipt the receipt id
np_shops:server:robbed { shopId, coords, robber, amount } A robbery ended. robber is the server id, amount the total loot. Fired for every robbery
np_shops:server:ownerChanged { shopId, owner, previous } A shop was bought or sold, or changed hands with its np_fuel station
np_shops:server:sold { source, identifier, shopId, name, count, price, stolen } A player sold an item at a pawn shop
np_shops:server:orderReady { shopId, orderId, ticket, identifier } A food order is ready to collect
np_shops:luxury:caseSmashed { shopId, case, coords, robber, items = { { name, count } }, first } A display case was smashed (Vangelico). first is true for the first case of a robbery
lua
-- register your shops again whenever np_shops (re)starts
AddEventHandler('np_shops:server:ready', function()
  exports.np_shops:RegisterShop('my_hardware', myShopDef)
end)

-- gang protection money
AddEventHandler('np_shops:server:robbed', function(e)
  print(('shop %s robbed by %d for $%d'):format(e.shopId, e.robber, e.amount))
end)

-- start a jewelry heist on the first smashed case
AddEventHandler('np_shops:luxury:caseSmashed', function(e)
  if e.first then startHeist(e.shopId, e.robber, e.coords) end
end)

Commands ​

Command Who Does
npshops_status Console or np_shops.admin Prints the integration report, the bridges (framework, inventory, dispatch, fuel) and the number of shops, brands, RPC methods and players
/shopadmin np_shops.editor Opens the shop editor (Config.Admin.command)
/shopowner Shop staff Opens the owner dashboard of the shop you stand at, or your first shop (Config.Ownership.command)
/shopowner buy Anyone Buys the shop you stand at

Key bindings ​

Players can rebind these in the FiveM key bindings (Settings → Key Bindings → FiveM):

Binding Default Does
np_shops: interact E (Config.Keys.interact) Opens the shop, pump, kitchen or office you stand at
np_shops: rob / hold G (Config.Robbery.key) Hold to rob a register, safe or display case

/ focuses the search inside the shop screen, and ESC closes every screen.

Staff tools ​

With np_admin running, np_shops adds these staff actions:

Action Node Does
Open shop editor np_shops.editor Opens the shop editor
Restock shop np_shops.stock Fills the stock of a shop
Reset robbery cooldown np_shops.robbery Clears a shop's robbery cooldowns and reopens it