OnBigWheelWin
OnBigWheelWin is called from BigWheelGame.Payout for each betting terminal whose slot matched the wheel result, right before the game multiplies the wager and pays it out into slot 5.
object OnBigWheelWin(BigWheelGame bigWheelGame, Item slot, BigWheelBettingTerminal terminal, int num)Parameters
| Parameter | Type | Description |
|---|---|---|
bigWheelGame | BigWheelGame | The BigWheelGame entity that ran the payout. Use it to read its position, net ID or prefab when you need to identify which wheel paid out. |
slot | Item | The Item sitting in the winning betting slot of the terminal's inventory. Its amount is the bet and its skin encodes the bet type; the plugin may move or remove it before the game pays out. |
terminal | BigWheelBettingTerminal | The BigWheelBettingTerminal that owns the winning inventory. Its inventory (slot 5 is the payout slot) and position are the most useful members. |
num | int | The payout multiplier for the winning bet type, taken from the wheel's color/type configuration (for example 2, 5 or 10). It is the factor applied to the bet amount, not the final payout. |
Return value
Returning null (or having no hook at all) lets the vanilla payout run: the wager is multiplied, removed from its slot and moved into slot 5, and the terminal is marked as paid. Returning any non-null object cancels that entire payout block for this terminal, so the player loses the wager without receiving winnings unless your code compensates.
How it works
The hook fires inside BigWheelGame.Payout once per winning terminal after the spin stops. The game first pulls the item out of the terminal slot matching the winning bet type, computes the multiplier num, and then calls OnBigWheelWin with the wheel, the wager slot, the terminal and the multiplier. Nothing is credited until the hook returns.
All four parameters are already resolved, so slot is non-null at this point and terminal is the owning terminal. Returning any non-null value from the hook skips the rest of the payout block for that terminal: the wager is not multiplied, removed from its slot, or moved into the cash-out slot, and the terminal is not marked as having a pending payout. Because the hook fires on a spinning-friendly event, avoid chatty logging; it runs per terminal per spin, which on a populated casino floor is frequent.
There is no useful narrowing here: the parameter types are already specific to the wheel, so the hook only runs for big wheel terminals. Keep methods private and null-check slot and terminal.inventory anyway because other plugins may interfere with the inventory between the game's read and your call.
Example plugin: Cap big wheel payouts to a server maximum
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Oxide.Core;
namespace Oxide.Plugins
{
[Info("BigWheel Payout Cap", "RustPluginGenerator", "1.0.0")]
[Description("Caps the maximum big wheel payout and optionally exempts privileged players.")]
public class BigWheelPayoutCap : RustPlugin
{
private const string PermExempt = "bigwheelpayoutcap.exempt";
private PluginConfig config;
private class PluginConfig
{
[JsonProperty("Maximum payout per spin")]
public int MaxPayout { get; set; } = 500;
[JsonProperty("Notify player when payout is capped")]
public bool Notify { get; set; } = true;
}
protected override void LoadDefaultConfig() => config = new PluginConfig();
protected override void LoadConfig()
{
base.LoadConfig();
try
{
config = Config.ReadObject<PluginConfig>();
if (config == null) throw new Exception();
}
catch
{
PrintWarning("Configuration file is invalid, using defaults");
LoadDefaultConfig();
}
SaveConfig();
}
protected override void SaveConfig() => Config.WriteObject(config);
protected override void LoadDefaultMessages()
{
lang.RegisterMessages(new Dictionary<string, string>
{
["Capped"] = "Your big wheel win was capped at {0}. Better luck next spin.",
["InvalidConfig"] = "MaxPayout must be at least 1, using defaults."
}, this);
}
private string Msg(string key, string userId = null, params object[] args)
{
return string.Format(lang.GetMessage(key, this, userId), args);
}
private void Init()
{
permission.RegisterPermission(PermExempt, this);
}
private void OnServerInitialized()
{
if (config.MaxPayout < 1)
{
PrintWarning(Msg("InvalidConfig"));
config.MaxPayout = 500;
SaveConfig();
}
}
private object OnBigWheelWin(BigWheelGame bigWheelGame, Item slot, BigWheelBettingTerminal terminal, int num)
{
if (slot == null || terminal == null || terminal.inventory == null) return null;
if (num <= 0 || config.MaxPayout < 1) return null;
var player = slot.GetOwnerPlayer();
if (player != null && permission.UserHasPermission(player.UserIDString, PermExempt)) return null;
long payout = (long)slot.amount * num;
if (payout <= config.MaxPayout) return null;
int allowedWager = config.MaxPayout / num;
if (allowedWager < 1) allowedWager = 1;
slot.amount = allowedWager;
slot.MarkDirty();
terminal.inventory.MarkDirty();
if (config.Notify && player != null && player.IsConnected)
{
player.ChatMessage(Msg("Capped", player.UserIDString, config.MaxPayout));
}
return null;
}
}
}The plugin listens on OnBigWheelWin and reads the maximum payout from its config (default 500). It computes the payout as slot.amount * num; if that value is at or below the cap it returns null and the game proceeds normally. If the payout exceeds the cap, the plugin reduces the slot's amount to MaxPayout / num (at least 1), marks the slot and the terminal inventory dirty, and returns null. The hook itself does not alter the game's payout calculation beyond changing the slot amount. Players with the permission bigwheelpayoutcap.exempt bypass the cap. When the cap is applied, a chat message notifies the player if the Notify config option is enabled and the owning player is connected.
Common use cases
Limit jackpots
Trim or redirect oversized wins so a lucky spin cannot dump a huge stack of an expensive item into a player's inventory.
Log casino winnings
Record the winner, terminal position and multiplier to plugin data for audit or leaderboard tracking, without blocking the payout.
Reward with custom currency
Cancel the vanilla item payout and credit an Economics or server-specific currency instead, giving the wheel a token-based economy.
Pitfalls
Cancelling loses the wager
Returning non-null skips the item move entirely, so the bet stays in its slot and the player receives nothing. If you cancel, you must hand out compensation yourself.
Do not double-credit
Returning null after moving items yourself will make the game move them again. Either modify the wager and return null, or cancel and do all payouts yourself, never both.
Inventory state matters
The game reads the slot before calling the hook, so removing or shrinking the item inside the hook changes what gets multiplied. Mark the container dirty after edits so clients see the new amount.
Build a plugin with OnBigWheelWin
Describe what should happen and get a compiled plugin that uses this hook.
Edit the prompt on the next screen. 2 free plugins a month, no card.
Last updated Oct 26, 2026. Found a mistake? Email support@rustplugingenerator.com.
Build a plugin with OnBigWheelWin
Generate