Installation

How to install Frozen Christmas Lottery: server.cfg order, admin access and the ticket items for ox_inventory, QBCore, Qbox, ESX and vRP.

On this page
  1. Put the frozen_xmaslottery folder in your resources directory.
  2. Add ensure frozen_xmaslottery to your server.cfg, below your framework, your inventory and oxmysql.
  3. Give your admins access (see below).
  4. Add the four ticket items to your inventory (see below) and copy the pictures from [IMAGES] into your inventory's image folder.
  5. Restart the server.
  6. In game, open /xmasadmin → Kiosks, walk to where the booth should be and press Place at my position.

The database tables are created on first start, so there is no SQL to import. Without oxmysql the script saves to the server's own KVP storage instead.

config.lua only tells the script what your server runs. Everything is on auto, which works on almost every server:

lua
Config.Framework = 'auto'   -- 'esx', 'qb', 'qbx', 'vrp', 'ox', 'nd', 'standalone'
Config.Inventory = 'auto'   -- 'ox' or 'framework'
Config.Target    = 'auto'   -- 'ox_target', 'qb-target', 'none' (press E)
Config.Notify    = 'auto'   -- 'ox_lib', 'esx', 'qb', 'gta'
Config.Storage   = 'auto'   -- 'oxmysql' or 'kvp'

Admin access

A player can open /xmasadmin when their framework group is god, superadmin or admin (edit Config.AdminGroups), or when they have the ace permission. In server.cfg:

add_ace group.admin frozenlottery.admin allow

Ticket items

The four default lotteries use these items. money_ticket and item_ticket have the same names as in v1, so old tickets keep working. Every lottery can use any item: set it in /xmasadmin → Lotteries, and the 📋 button next to the item field shows the exact code for that item.

ox_inventory

In ox_inventory/data/items.lua:

lua
['money_ticket']  = { label = 'Candy Cane Scratch', weight = 10, stack = true, close = true, server = { export = 'frozen_xmaslottery.useTicket' } },
['item_ticket']   = { label = "Santa's Sack ticket", weight = 10, stack = true, close = true, server = { export = 'frozen_xmaslottery.useTicket' } },
['wheel_ticket']  = { label = 'Frosty Wheel ticket', weight = 10, stack = true, close = true, server = { export = 'frozen_xmaslottery.useTicket' } },
['golden_ticket'] = { label = 'Golden Star ticket', weight = 10, stack = true, close = true, server = { export = 'frozen_xmaslottery.useTicket' } },

This works on every framework that runs ox_inventory, including standalone.

QBCore / Qbox without ox_inventory

In qb-core/shared/items.lua:

lua
money_ticket  = { name = 'money_ticket',  label = 'Candy Cane Scratch',  weight = 10, type = 'item', image = 'money_ticket.png',  unique = false, useable = true, shouldClose = true, description = 'Merry Christmas!' },
item_ticket   = { name = 'item_ticket',   label = "Santa's Sack ticket", weight = 10, type = 'item', image = 'item_ticket.png',   unique = false, useable = true, shouldClose = true, description = 'Merry Christmas!' },
wheel_ticket  = { name = 'wheel_ticket',  label = 'Frosty Wheel ticket', weight = 10, type = 'item', image = 'wheel_ticket.png',  unique = false, useable = true, shouldClose = true, description = 'Merry Christmas!' },
golden_ticket = { name = 'golden_ticket', label = 'Golden Star ticket',  weight = 10, type = 'item', image = 'golden_ticket.png', unique = false, useable = true, shouldClose = true, description = 'Merry Christmas!' },

ESX without ox_inventory

sql
INSERT IGNORE INTO items (name, label, weight) VALUES
('money_ticket', 'Candy Cane Scratch', 1),
('item_ticket', 'Santa''s Sack ticket', 1),
('wheel_ticket', 'Frosty Wheel ticket', 1),
('golden_ticket', 'Golden Star ticket', 1);

vRP

  • vRP 0.5 (Dunko): the ticket items are registered automatically with a "Use" option. If an item already exists in cfg/items.lua, add a Use choice there that calls the export below.
  • vRPex and forks: add the items to your item list, and call the export from the item's use code:
lua
exports.frozen_xmaslottery:UseTicket(source, 'money_ticket')
  • On any vRP server, tickets can always be played at a booth ("Play a ticket from your pocket").
  • Money: money is the wallet, bank is the bank and black_money is the dirty_money item.

Any other inventory

Call exports.frozen_xmaslottery:UseTicket(source, itemName) from the inventory's use-item code.

Supported resources

FrameworksESX Legacy and old ESX, QBCore, Qbox, vRP 0.5 (Dunko) and vRPex, ox_core, ND_Core, standalone (with ox_inventory)
Inventoriesox_inventory (any framework), ESX and QB inventories and everything that hooks into them (qs, ps, lj, codem, core and more)
Targetox_target, qb-target, or a "press E" prompt
Notificationsox_lib, ESX, QB or GTA
Databaseoxmysql, or the server's KVP storage

Next steps

Still stuck?Ask on our Discord