Developers
Integrate other resources with lumix_coinshop exports and net events.
NUI callbacks used by the tablet/admin UI (lumix_coinshop:server:GetCatalogData, admin CRUD, games, trade internals, …) are internal — use the APIs below for external scripts.
Server exports
lua
local coins = exports.lumix_coinshop:GetCoins(source)
exports.lumix_coinshop:AddCoins(source, 100)
exports.lumix_coinshop:RemoveCoins(source, 50)
exports.lumix_coinshop:SetCoins(source, 500)| Export | Returns / effect |
|---|---|
GetCoins(source) | Current sapphire balance (number) |
AddCoins(source, amount) | Add sapphires; syncs UI if online |
RemoveCoins(source, amount) | Remove sapphires |
SetCoins(source, amount) | Set absolute balance |
Client exports
lua
-- Open the crate UI for the local player
exports.lumix_coinshop:OpenCrate(crateId, hasKey, slotId)| Arg | Notes |
|---|---|
crateId | Crate id from coinadmin |
hasKey | Player has a matching key |
slotId | Inventory slot of the key (if any) |
Client events
Trigger from server (or another client resource with care):
lua
-- Open shop tablet (dashboard)
TriggerClientEvent('lumix_coinshop:client:OpenShop', source)
-- Toggle shop
TriggerClientEvent('lumix_coinshop:client:ToggleMenu', source)
-- VIP section
TriggerClientEvent('lumix_coinshop:client:OpenVipMenu', source)
-- Admin panel
TriggerClientEvent('lumix_coinshop:client:OpenAdmin', source)
-- Force-refresh sapphire balance in NUI
TriggerClientEvent('lumix_coinshop:client:UpdateBalance', source, newBalance)
-- Invalidate cached shop data so the next open refetches
-- key: 'catalog' | 'bundle' | 'vip' | 'dashboard'
TriggerClientEvent('lumix_coinshop:client:updateData', source, 'catalog', nil)Trade / VIP / crates (client)
| Event | Purpose |
|---|---|
lumix_coinshop:client:OpenTradeSession | Open trade UI |
lumix_coinshop:client:ReceiveTradeInvite | Incoming trade invite |
lumix_coinshop:client:UpdateTradeSession | Live trade state |
lumix_coinshop:client:CloseTradeSession | Close trade |
lumix_coinshop:client:TradeInviteDeclined | Invite declined |
lumix_coinshop:client:VipRedeemed | VIP / kit redeemed feedback |
lumix_coinshop:client:SpawnVipCar | Spawn VIP vehicle locally |
lumix_coinshop:client:RepairVipVehicle | Repair current VIP vehicle |
lumix_coinshop:client:SetupCrateUI | Prepare crate header |
lumix_coinshop:client:BlackjackState | Blackjack table snapshot |
Server events
lua
-- Used by client /vip extras (money wash)
TriggerServerEvent('lumix_coinshop:server:Vip:MoneyWash', amount)Prefer exports for giving/taking sapphires from other resources instead of inventing new server events.
Useful commands
| Command | Who | Effect |
|---|---|---|
/coinshop | Players | Toggle shop |
/vipmenu | Players | Open VIP section |
/trade | Players | Open trade |
/vip | VIP | Client extras menu |
/coinadmin | Admins | Admin panel |
/coinshop:show | Admins | Force-open shop |
/addcoin /removecoin /setcoin | Admins | Balance ops (names configurable) |
/keyall | Restricted | Give crate keys to all online |
tebexset / coinshop_tebex | Console | Queue Tebex redeem |
VIP helper commands also exist (kit, kits, vipcar, repair, playtimekit, …) — see server command registrations for params.
Dependency
lua
dependency 'lumix_coinshop'
-- and ensure lumix_bridge is started