Configuration
Everything lives in config.lua, which stays editable in both the Open and Encrypted variant. There are no framework, inventory or notification options - those are handled by vns-core.
Spin limits
| Option | Default | What it does |
|---|---|---|
Config.DailySpin |
true |
true: one free spin per day, stored in the vns_wheel_spins table. false: unlimited spins, each costing Config.SpinMoney. |
Config.ResetSpin |
'16:21' |
Server time (24h HH:MM) of the daily reset. A player can spin again once their last spin happened before the most recent reset. Only used with Config.DailySpin = true. |
Config.UseCitizenID |
false |
true: the limit is per character (framework identifier). false: per account (Rockstar license), so all characters share one daily spin. |
Config.SpinMoney |
5000 |
Price per spin, paid from cash. Only used with Config.DailySpin = false. |
Only one spin can run at a time - while the wheel is spinning, other players have to wait.
Positions
| Option | Default | What it does |
|---|---|---|
Config.K4MB1_Casino_Map |
true |
Auto-detect the K4MB1 casino's wheel and podium, no coordinates needed. |
Config.SpawnWheel |
true |
true if your map has no wheel (the script spawns one at Config.WheelPos); false if a wheel prop already stands there. |
Config.WheelPos |
{x = 948.25, y = 63.44, z = 75.40, h = 59.0} |
Where the wheel spawns, or where the map's wheel stands. Also the interaction point - players press E within 1.5 m. |
Config.VehiclePos |
{x = 953.59, y = 69.89, z = 75.24, h = 254.5} |
Podium display car position (non-K4MB1 maps). |
Config.VehicleRot |
true |
Slowly rotate the podium car. |
Config.VehicleWinPos |
vector4(933.29, -3.33, 78.34, 149.51) |
Where a won car spawns, with the winner seated in the driver seat. |
Podium cars
Config.Cars is a plain list of vehicle spawn names:
Config.Cars = {
[1] = 'deveste',
[2] = 'italigto',
-- ...
}
On every resource start the server picks one random car from this list. That car is shown on the podium and is the car the car prize pays out until the next restart. Winning it registers the vehicle to the player through vns-core and spawns it at Config.VehicleWinPos. If registration fails, the player gets the car_failed notification.
Prizes
Config.Prices has 20 entries, one per wheel segment, in order:
[4] = {type = 'item', name = 'casinochips', count = 25000, sound = 'chips', probability = {a = 10, b = 20}},
| Field | What it does |
|---|---|
type |
'money' (paid into the bank), 'item' (added to the inventory) or 'car' (the podium car). |
name |
The item name. Ignored for money and car. |
count |
How many items or how much money. Use 1 for cars. |
sound |
Win stinger: 'car', 'cash', 'chips', 'clothes', 'mystery' or 'win'. |
probability |
The segment wins when the server's 1-1000 roll rnd satisfies rnd > a and rnd <= b. |
The probability windows must line up back to back (a of one entry = b of the previous) and the last b should be 1000, otherwise some rolls match no prize. The width of a window is the chance in tenths of a percent - the default table runs from 0.1% for the car to 10% for the most common cash prize. The wheel lands on the segment matching the entry's index.
Warning
Item prizes must exist in your inventory. If an item can't be added, nothing is given and the player gets the item_missing notification.
Texts
All player-facing texts are in Config.Lang:
| Key | Default |
|---|---|
help_spin |
'Press ~INPUT_CONTEXT~ to spin the Lucky Wheel' |
already_spun |
'You have already spined the wheel' |
no_money |
'You do not have money to spin' |
won_car |
'You won the car' |
won_item |
'You won %sx %s' (count, item label) |
won_money |
'You won %s$' |
item_missing |
'This item does not exist, contact server owner! \| Item: %s' |
car_failed |
'The vehicle could not be registered, contact server owner!' |
Sounds
All audio is native GTA casino audio - Spin_Start when the wheel starts and the win stingers from dlc_vw_casino_lucky_wheel_sounds, chosen per prize with the sound field. There is nothing to stream.
Open files
| File | Functions |
|---|---|
client/client_open.lua |
ClientNotification, helpText, SpawnPrizeVehicle, SetVehicleFuel, GiveVehicleKeys |
server/server_open.lua |
GetPlayerFromId, GetSpinIdentifier (daily-spin key), Notify, RemoveSpinCost (cash), GiveMoneyPrize (bank), GiveItemPrize, GetItemLabel, GiveVehiclePrize |
See Installation for the fuel and key hooks.