Skip to content

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)
ExportReturns / 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)
ArgNotes
crateIdCrate id from coinadmin
hasKeyPlayer has a matching key
slotIdInventory 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)

EventPurpose
lumix_coinshop:client:OpenTradeSessionOpen trade UI
lumix_coinshop:client:ReceiveTradeInviteIncoming trade invite
lumix_coinshop:client:UpdateTradeSessionLive trade state
lumix_coinshop:client:CloseTradeSessionClose trade
lumix_coinshop:client:TradeInviteDeclinedInvite declined
lumix_coinshop:client:VipRedeemedVIP / kit redeemed feedback
lumix_coinshop:client:SpawnVipCarSpawn VIP vehicle locally
lumix_coinshop:client:RepairVipVehicleRepair current VIP vehicle
lumix_coinshop:client:SetupCrateUIPrepare crate header
lumix_coinshop:client:BlackjackStateBlackjack 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

CommandWhoEffect
/coinshopPlayersToggle shop
/vipmenuPlayersOpen VIP section
/tradePlayersOpen trade
/vipVIPClient extras menu
/coinadminAdminsAdmin panel
/coinshop:showAdminsForce-open shop
/addcoin /removecoin /setcoinAdminsBalance ops (names configurable)
/keyallRestrictedGive crate keys to all online
tebexset / coinshop_tebexConsoleQueue 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

DMCA.com Protection Status

Lumix Scripts operates independently and is not authorized, sponsored, or endorsed by Cfx.re, Rockstar Games, or Take-Two Interactive.