Installation
Requirements
| Dependency | Notes |
|---|---|
| oxmysql | Required — all stats are stored in MySQL |
| ESX / QBCore | One framework required (MBT.Framework must match) |
| ox_inventory | Optional — used by the default prize delivery preset |
Steps
Download and place the resource
Download mbt_ratio from the MBT Store.
Place it keeping the exact resource name:
resources/
└── [mbt]/
└── mbt_ratio/
├── client/
├── server/
├── html/
├── stream/
├── config.lua
└── fxmanifest.luaSet your framework
Open config.lua and set MBT.Framework to match your server:
MBT.Framework = "ESX" -- or "QB"Place the scoreboard prop
The script spawns a custom mbt_scoreboard prop in the world. Set its position and heading in config.lua:
MBT.Prop = {
["Model"] = `mbt_scoreboard`,
["Coords"] = vector3(195.17, -933.81, 32.06),
["Heading"] = 324.49,
}Set MBT.DUI.Coords to the position of the DUI screen surface on the prop:
MBT.DUI = {
["Coords"] = vector3(192.67, -934.52, 34.41),
["Distance"] = 20.0, -- render distance in GTA units
["Refresh"] = 30, -- leaderboard refresh interval in seconds
...
}Configure the prize draw
Edit MBT.PrizeDraw in config.lua to choose the draw frequency and prize pool:
MBT.PrizeDraw = {
["Frequency"] = "Weekly", -- "Weekly" or "Monthly"
["Weekly"] = { ["Day"] = "Tuesday" },
["PrizeInfo"] = {
{
Type = "item",
Name = "WEAPON_PISTOL50",
DropChances = {
{ RollRange = { Min = 1, Max = 97 }, Quantity = 1 },
{ RollRange = { Min = 98, Max = 100 }, Quantity = 2 },
}
},
{
Type = "item",
Name = "money",
DropChances = {
{ RollRange = { Min = 1, Max = 85 }, Quantity = 50 },
}
},
}
}Then fill in MBT.DeliverPrizeFunction with your inventory system. A preset for ox_inventory is already included (active by default). A commented preset for QBCore inventory is also provided.
Add to server.cfg
ensure oxmysql
ensure es_extended # or qb-core
ensure mbt_ratiooxmysql and your framework must start before mbt_ratio.
Database
The script auto-creates the mbt_ratio table on first start:
CREATE TABLE IF NOT EXISTS `mbt_ratio` (
`identifier` varchar(50) NOT NULL,
`playerName` varchar(70) NOT NULL,
`deaths` int(11) DEFAULT 0,
`kills` int(11) DEFAULT 0,
`headshots` int(11) DEFAULT 0,
PRIMARY KEY (`identifier`)
);No manual setup is needed.
Verifying the install
Join the server and get killed by another player (or kill another player). Open your stats panel with F7 — you should see your kills, deaths and KD ratio.
Walk toward the scoreboard prop. Within 20 units the DUI leaderboard should render on the prop's screen surface, showing all players ranked by KD.
If you set MBT.UseTxAdmin = false, you must call the server event mbt_ratio:manualSaving yourself before shutting the server down, otherwise unsaved stats will be lost.
