Configuration
Welcome to the MBT Ktf Configuration Guide!
MBT.Debug = falseThis variable controls whether the debug mode is enabled. When set to true, it can help you diagnose issues by providing additional debug information.
MBT.MinPlayer = { ["Active"] = true, ["Amount"] = 2 }This variable defines the minimum number of players required to start the event. The "Active" key with a value of true indicates that this feature is enabled. The "Amount" key specifies the minimum number of players required to start the event.
MBT.WaitPlayerTime = 10This variable determines the waiting time for players before the event starts. It specifies the duration in seconds that players will wait before the event activities begin.
MBT.FlagModel = `prop_golfflag`This variable specifies the model that represents the flag in the game. The model name should be provided as a string (e.g., prop_golfflag).
MBT.EventDuration = 180This variable sets the duration of the game activities in seconds. It determines how long the entire event will last, including capturing the flag and other gameplay elements.
MBT.AreaDistance = 80This variable defines the size of the game area. It determines the distance that players are allowed to move within during the event.
MBT.RespawnTime = 7This variable sets the time it takes for a player to respawn after being eliminated from the game. The respawn time is specified in seconds.
MBT.CaptureTime = 10This variable determines the time it takes to capture the flag. When a player interacts with the flag to capture it, this variable defines the time required for the capture to be successful.
MBT.DedicatedBucket = 400This variable specifies a dedicated bucket for the game. It appears to be a numerical value that may be used for a specific purpose in the event's logic.
MBT.PickupsRefresh = 15This variable sets the time interval for respawning pickups in the game. It determines how often the pickups (such as weapons or items) will reappear for players to collect.
MBT.MaxKickAttempt = 5This variable sets the maximum number of attempts a player can be kicked from the game before being permanently removed. It's a safeguard against potential abuse.
MBT.UpdateVip = 3This variable sets the time interval for updating the top player in the game. It determines how often the game updates the player who currently has the highest score.
MBT.UpdateFlagOwnerPosition = 10This variable sets the time interval for updating the position of the flag owner in the game. It determines how often the game updates the position of the player who currently possesses the flag.
MBT.EnableStashes = trueThis variable enables or disables stashes, which players can use to deposit their inventory items. If set to true, players can stash their items before the game starts.
MBT.Blips = {
["FlagOwner"] = {["Sprite"] = 84, ["Colour"] = 1, ["Scale"] = 1.0},
["GameArea"] = {["Colour"] = 1, ["Scale"] = 1.0},
["Location"] = {["Sprite"] = 419, ["Colour"] = 1, ["Scale"] = 1.0},
}This variable contains blip settings for different game elements such as the flag owner, game area, and location markers. Each blip setting is specified as a sub-table with keys like "Sprite," "Colour," and "Scale."
MBT.Ped = {
["PedHash"] = `csb_isldj_04`,
["Coords"] = vector3(-1055.05, 4915.59, 211.82),
["Heading"] = 185.87,
["Scenario"] = "WORLD_HUMAN_SMOKING"
}This variable specifies settings for a specific character (pedestrian) in the game. It includes information such as the ped's model, coordinates, heading, and scenario.
MBT.Locations = {
["PreGameLocation"] = vector3(-1052.37, 4911.14, 210.35),
["GameArea"] = vector3(-1114.75, 4923.61, 202.05),
["StashLocation"] = vector3(-1058.85, 4915.94, 212.0),
["FirstFlag"] = vector3(-1165.240, 4925.880, 221.982),
["WinnerSpot"] = {
["Coords"] = vector3(-1169.88, 4926.89, 223.38),
["Heading"] = 89.23
}
}This variable contains settings for various game locations such as pre-game location, game area, stash location, flag spawn point, and winner's spot. Coordinates and headings are specified for each location.
MBT.Marker = {
["Type"] = 23,
["Coords"] = vector3(-1058.791, 4915.471, 210.838),
["Rot"] = { ["X"] = 0, ["Y"] = 0, ["Z"] = 0 },
["Scale"] = { ["X"] = 0.5, ["Y"] = 0.5, ["Z"] = 0.5 },
["Color"] = { ["R"] = 10, ["G"] = 255, ["B"] = 0, ["A"] = 100 }
}This variable contains settings for in-game markers. It includes information such as marker type, coordinates, rotation, scale, and color.
MBT.ClearInventoryEvent = function (source)
-- If you have an event to clear the inventory, put it here
exports.ox_inventory:ClearInventory(source)
-- local Player = QBCore.Functions.GetPlayer(source)
-- Player.Functions.ClearInventory()
endThis function is used to clear a player's inventory for the event. It may be called when a player enters the game to ensure they start with an empty inventory.
MBT.CustomMenu = function ()
lib.registerMenu({
id = 'ktf_menu_deposit',
title = 'King Of The Flag - Deposit',
position = 'top-right',
options = {
{label = MBT.Labels["storage_deposit"]["Text"], args = {someArg = 'deposit'}},
{label = MBT.Labels["storage_withdraw"]["Text"], args = {someArg = 'withdraw'}}
}
}, function(selected, scrollIndex, args)
print(selected, scrollIndex, args)
-- mbt_ktf:handleStoring
end)
lib.showMenu('ktf_menu_deposit')
--[[
local ktfQBMenu = {
{
header = "King Of The Flag - Deposit",
isMenuHeader = true
}, {
header = MBT.Labels["storage_deposit"]["Text"],
params = {
isServer = true,
event = "mbt_ktf:handleStoring",
args = {
actionType = "deposit"
}
}
}, {
header = MBT.Labels["storage_withdraw"]["Text"],
params = {
isServer = true,
event = "mbt_ktf:handleStoring",
args = {
{actionType = "withdraw"}
}
}
}
}
exports['qb-menu']:openMenu(ktfQBMenu)
]]
endThis function creates a custom menu for the game event. Players can interact with the menu to perform actions such as depositing or withdrawing items.
MBT.DisplayHint = true -- Display hint if using markerThis variable determines whether to display hints to players using in-game markers.
MBT.CustomHint = {
["Enabled"] = false,
["Looped"] = true,
["Show"] = function (label)
-- ox_lib:showTextUI(label)
MBT.CustomFunctions["loop_notif"](label)
end,
["Hide"] = function ()
-- exports.ox_lib:hideTextUI()
end
}This variable contains settings for custom hints displayed to players. It includes functions to show and hide hints along with other options.
MBT.Target = {
["Active"] = true,
["StartChar"] = function (entity)
local entities = {entity}
exports.ox_target:addLocalEntity(entities, {
{
name = 'start',
event = "mbt_ktf:startPreMatch",
icon = "fa-solid fa-gamepad",
label = "Arrange Match",
distance = 1.5,
canInteract = function(entity, distance, coords, name, bone)
return not IsEntityDead(entity)
end
}
})
end,
["Storing"] = function ()
local tCoords = MBT.Locations["StashLocation"]
exports.ox_target:addBoxZone({
coords = tCoords,
size = vec3(1.4, 0.6, 2.2),
rotation = 8.0,
debug = false,
options = {
{
name = 'box',
distance = 1.0,
serverEvent = 'mbt_ktf:handleStoring',
icon = 'fa-solid fa-cube',
label = MBT.Labels["storage_deposit"]["Text"],
actionType = "deposit"
},
{
name = 'checkdep',
distance = 1.0,
serverEvent = 'mbt_ktf:handleStoring',
icon = 'fa-solid fa-cube',
label = MBT.Labels["storage_withdraw"]["Text"],
actionType = "check"
}
}
})
end
}This variable contains settings for in-game target interactions. It includes functions for displaying interaction options to players.
MBT.Pickups = {
[1] = {["Coords"] = vector3(-1133.21, 4899.36, 219.0), ["Hash"] = `PICKUP_WEAPON_HAMMER`},
[2] = {["Coords"] = vector3(-1144.96, 4908.92, 220.97), ["Hash"] = `PICKUP_WEAPON_SWITCHBLADE`},
[3] = {["Coords"] = vector3(-1108.61, 4965.12, 218.78), ["Hash"] = `PICKUP_WEAPON_WRENCH`},
[4] = {["Coords"] = vector3(-1062.26, 4920.55, 211.8), ["Hash"] = `PICKUP_WEAPON_STONE_HATCHET`},
[5] = {["Coords"] = vector3(-1073.88, 4888.97, 214.79), ["Hash"] = `PICKUP_WEAPON_MACHETE`},
[6] = {["Coords"] = vector3(-1132.45, 4895.13, 219.0), ["Hash"] = `PICKUP_WEAPON_DAGGER`},
[7] = {["Coords"] = vector3(-1145.54, 4942.72, 225.79), ["Hash"] = `PICKUP_WEAPON_CROWBAR`},
[8] = {["Coords"] = vector3(-1133.8, 4973.51, 219.82), ["Hash"] = `PICKUP_WEAPON_BATTLEAXE`},
[9] = {["Coords"] = vector3(-1064.55, 4906.83, 212.14), ["Hash"] = `PICKUP_HEALTH_STANDARD`}
}This variable specifies settings for different pickups (items, weapons) in the game. Each pickup is defined with coordinates and a hash value.
MBT.AllowedWeapon = {
["4191993645"] = 1, -- Hatchet
["940833800"] = 1, -- Stone Hatchet
["1317494643"] = 1, -- Knife
["3756226112"] = 1, -- Switchblade
["419712736"] = 1, -- Wrench
["3713923289"] = 1, -- Machete
["2578778090"] = 1, -- Hammer
["2460120199"] = 1, -- Dagger
["2227010557"] = 1, -- Crowbar Check
["3441901897"] = 1, -- Battleaxe
["2725352035"] = 1 -- Unarmed
}This variable lists allowed weapon hashes for the event. It defines which weapons players are permitted to use during the event.
MBT.Camera = {
["Intro"] = {
[1] = {
["Coords"] = vector3(-1050.76, 4935.72, 227.29),
["Rotation"] = vector3(-10, 0, 100)
},
[2] = {
["Coords"] = vector3(-1186.44, 4935.09, 246.11),
["Rotation"] = vector3(-30, 0, -100)
},
},
["Winner"] = {
["Coords"] = vector3(-1173.97, 4926.81, 224.59),
["Rotation"] = vector3(0, 0, 270)
}
}This variable specifies camera settings for different in-game camera animations. It includes coordinates and rotations for intro and winner animations.
MBT.Enemies = {
["SpawnPoints"] = {
vector3(-1135.8, 4915.09, 219.89),
vector3(-1125.69, 4896.42, 218.47),
vector3(-1089.39, 4882.76, 215.9),
vector3(-1130.01, 4956.78, 221.28),
vector3(-1107.44, 4884.33, 215.54),
vector3(-1107.0, 4877.01, 215.78),
vector3(-1098.43, 4873.69, 216.26),
vector3(-1075.58, 4897.9, 214.27),
vector3(-1065.39, 4897.15, 212.85),
vector3(-1091.61, 4931.01, 214.86),
vector3(-1093.45, 4961.41, 216.88)
},
["Models"] = {
`a_m_m_hillbilly_02`
},
["Max"] = 3
}This variable defines enemy spawn points and models. It includes enemy spawn coordinates and allowed enemy models.
MBT.SpawnPoints = {
vector3(-1110.86, 4930.61, 218.32),
vector3(-1146.62, 4968.79, 220.70),
vector3(-1137.39, 4877.70, 212.92),
vector3(-1164.38, 4886.47, 214.28),
vector3(-1148.47, 4950.21, 226.23),
vector3(-1065.74, 4967.04, 209.87),
vector3(-1053.52, 4948.77, 209.94),
vector3(-1060.91, 4923.99, 211.19),
vector3(-1094.04, 4863.53, 217.17),
vector3(-1101.91, 4877.20, 216.45),
vector3(-1122.04, 4892.62, 218.47),
vector3(-1149.81, 4897.68, 218.28),
vector3(-1176.32, 4914.02, 220.19),
vector3(-1091.53, 4957.93, 217.62),
vector3(-1076.01, 4940.09, 212.99),
vector3(-1109.87, 4901.10, 216.36)
}This variable lists spawn points for players in the game. Players will be randomly spawned at these coordinates when they join the game.
MBT.WinAnimations = {
{ ["Dict"] = "anim@amb@nightclub@dancers@podium_dancers@", ["Anim"] = "hi_dance_facedj_17_v2_male^5"},
{ ["Dict"] = "anim@amb@nightclub@mini@dance@dance_solo@male@var_b@", ["Anim"] = "high_center_down"},
{ ["Dict"] = "anim@amb@nightclub@mini@dance@dance_solo@male@var_a@", ["Anim"] = "high_center"},
{ ["Dict"] = "anim@amb@casino@mini@dance@dance_solo@female@var_a@", ["Anim"] = "med_center"},
{ ["Dict"] = "misschinese2_crystalmazemcs1_cs", ["Anim"] = "dance_loop_tao"},
{ ["Dict"] = "misschinese2_crystalmazemcs1_ig", ["Anim"] = "dance_loop_tao"},
{ ["Dict"] = "missfbi3_sniping", ["Anim"] = "dance_m_default"},
{ ["Dict"] = "anim@amb@nightclub@mini@dance@dance_solo@female@var_a@", ["Anim"] = "med_center_up"},
{ ["Dict"] = "special_ped@mountain_dancer@monologue_3@monologue_3a", ["Anim"] = "mnt_dnc_buttwag"},
{ ["Dict"] = "move_clown@p_m_zero_idles@", ["Anim"] = "fidget_short_dance"},
{ ["Dict"] = "move_clown@p_m_two_idles@", ["Anim"] = "fidget_short_dance"},
{ ["Dict"] = "anim@amb@nightclub@lazlow@hi_podium@", ["Anim"] = "danceidle_hi_11_buttwiggle_b_laz"},
{ ["Dict"] = "timetable@tracy@ig_5@idle_a", ["Anim"] = "idle_a"},
{ ["Dict"] = "timetable@tracy@ig_8@idle_b", ["Anim"] = "idle_d"},
{ ["Dict"] = "anim@amb@casino@mini@dance@dance_solo@female@var_b@", ["Anim"] = "high_center"},
{ ["Dict"] = "anim@mp_player_intcelebrationfemale@the_woogie", ["Anim"] = "the_woogie"},
{ ["Dict"] = "rcmnigel1bnmt_1b", ["Anim"] = "dance_loop_tyler"}
}This variable lists different animations that can be played when a player wins the game. It includes animation dictionaries and names.
MBT.Rewards = {
[1] = {["Name"] = "money", ["Quantity"] = {["Min"] = 500, ["Max"] = 1000}},
[2] = {["Name"] = "water", ["Quantity"] = {["Min"] = 1, ["Max"] = 3}},
[3] = {["Name"] = "ouija", ["Quantity"] = {["Min"] = 1, ["Max"] = 3}}
}This variable specifies different rewards given to players. Each reward is defined by a description, function, and optional data.
MBT.GiveReward = function (id, item)
--local player = QBCore.Functions.GetPlayer(id)
-- player.Functions.AddItem(item["Name"], item["Quantity"], false, { description = "Premio Partita CTF" }); TriggerEvent("inventory:client:ItemBox", QBCore.Shared.Items[item["Name"]], "add");
if exports.ox_inventory:CanCarryItem(id, item["Name"], item["Quantity"]) then
exports.ox_inventory:AddItem(id, item["Name"], item["Quantity"], { description = "Reward KTF" })
end
endThis variable specifies different rewards given to players. Each reward is defined by a description, function, and optional data.
MBT.Language = {
["States"] = {
[true] = "Busy",
[false] = "Available"
},
}This variable contains game text for different languages. It includes keys for various messages and UI elements.
MBT.PauseStatus = function (bool)
-- If you have an event to pause the status, put it here`
-- Ex: TriggerEvent("esx_status:setPauseStatus", bool)
endThis function is used to pause a player's status in the event. It may control whether a player can take actions during specific moments.
MBT.Progress = function (posOutcome, negOutcome)
if exports.ox_lib:progressCircle({
duration = 2000,
position = 'bottom',
label = MBT.Labels["progress_capt"]["Text"],
useWhileDead = false,
canCancel = true,
disable = {
move = true,
car = true,
combat = true
},
anim = {
dict = 'mini@repair',
clip = 'fixing_a_ped'
},
}) then
posOutcome()
else
negOutcome()
end
-- If you don't have any progress event, you can put something like this:
--[[
RequestAnimDict("mini@repair")
while not HasAnimDictLoaded("mini@repair") do Wait(33) end
Wait(100)
TaskPlayAnim(PlayerPedId(), "mini@repair", "fixing_a_ped", 8.0, 8.0, 6000, 49, 0, 0, 0, 0)
Wait(6000)
posOutcome()
RemoveAnimDict("mini@repair")
]]
endThis function handles progress events within the game. It likely manages positive and negative outcomes for players.
MBT.Notification = function (data)
exports.ox_lib:notify({
title = data.title or 'Title',
description = data.description or 'Text',
duration = data.duration or 5000,
position = data.position or 'top',
style = {
backgroundColor = data.bgcolor or '#141517',
color = data.color or '#909296'
},
icon = data.icon or 'ban',
iconColor = data.iconColor or '#C53030'
})
endThis function is used to display notifications to players during the game. It likely shows important messages or updates.
MBT.UIHelp = function (data)
exports.ox_lib:showTextUI(data.text or "", {
position = data.position or "right-center",
icon = data.icon or 'hand',
style = {
borderRadius = data.bradius or 0,
backgroundColor = data.bgcolor or '#48BB78',
color = data.color or 'white'
}
})
endThis function displays UI help text to players, providing information about in-game mechanics or controls.
MBT.HideUIHelp = function ()
exports.ox_lib:hideTextUI()
endThis function hides UI help text that was previously displayed using the MBT.UIHelp function.
MBT.Labels = {
["game_aborted"] = {
["Title"] = "Error!",
["Position"] = "center-right",
["Description"] = "Game Aborted!",
["Duration"] = 4000,
["Icon"] = "ban",
["IconColor"] = "#C53030",
["BgColor"] = "#141517",
["Color"] = "#909296"
},
["no_players_nearby"] = {
["Title"] = "Error!",
["Position"] = "center-right",
["Description"] = "No player nearby!",
["Duration"] = 4000,
["Icon"] = "ban",
["IconColor"] = "#C53030",
["BgColor"] = "#141517",
["Color"] = "#909296"
},
["already_in_progress"] = {
["Title"] = "Error!",
["Position"] = "center-right",
["Description"] = "A game is already in progress!",
["Duration"] = 4000,
["Icon"] = "ban",
["IconColor"] = "#C53030",
["BgColor"] = "#141517",
["Color"] = "#909296"
},
["min_players"] = {
["Title"] = "Error!",
["Position"] = "center-right",
["Description"] = "A minimum of %s players are required to start the game!",
["Duration"] = 4000,
["Icon"] = "circle-info",
["IconColor"] = "#C53030",
["BgColor"] = "#141517",
["Color"] = "#909296"
},
["back_to_area"] = {
["Title"] = "Error!",
["Position"] = "center-right",
["Description"] = "Come back in the area or you will be kicked!",
["Duration"] = 4000,
["Icon"] = "ban",
["IconColor"] = "#C53030",
["BgColor"] = "#141517",
["Color"] = "#909296"
},
["kicked"] = {
["Title"] = "Error!",
["Position"] = "center-right",
["Description"] = "You have being kicked from game!",
["Duration"] = 4000,
["Icon"] = "exclamation",
["IconColor"] = "#C53030",
["BgColor"] = "#141517",
["Color"] = "#909296"
},
["no_deposit"] = {
["Title"] = "Error!",
["Position"] = "center-right",
["Description"] = "You have nothing to withdraw, deposit something first!",
["Duration"] = 4000,
["Icon"] = "ban",
["IconColor"] = "#C53030",
["BgColor"] = "#141517",
["Color"] = "#909296"
},
["already_deposit"] = {
["Title"] = "Error!",
["Position"] = "center-right",
["Description"] = "You already have a stash, check it!!!",
["Duration"] = 4000,
["Icon"] = "ban",
["IconColor"] = "#C53030",
["BgColor"] = "#141517",
["Color"] = "#909296"
},
["items_stashed"] = {
["Title"] = "Storage!",
["Position"] = "center-right",
["Description"] = "Your inventory has been stashed!",
["Duration"] = 4000,
["Icon"] = "ban",
["IconColor"] = "#C53030",
["BgColor"] = "#141517",
["Color"] = "#909296"
},
["stash_warn"] = {
["Title"] = "Warning!",
["Position"] = "center-right",
["Duration"] = 4000,
["Description"] = "Remember to stash your inventory in the deposit, it will be cleaned at the start of game!",
["Icon"] = "ban",
["IconColor"] = "#C53030",
["BgColor"] = "#141517",
["Color"] = "#909296"
},
["ui_hint_flag"] = {
["Text"] = "[E] - Pick flag",
["Position"] = "right-center",
["Icon"] = "flag",
["BRadius"] = 0,
["BgColor"] = "#141517",
["Color"] = "#909296"
},
["ui_hint_select"] = {
["Text"] = "◀️ ▶️ Choose| Player \n 🔽 Select/Unselect Player \n [ENTER] Confirm \n [BACKSPACE] Cancel",
["Position"] = "left-center",
["Icon"] = "users",
["BRadius"] = 0,
["BgColor"] = "#141517",
["Color"] = "#909296"
},
["flag_nui"] = {
["Text"] = "Capture the flag",
["SubText"] = "Keep possession of the flag as long as possible"
},
["progress_capt"] = {
["Text"] = "Capture the flag"
},
["game_starting"] = {
["Text"] = "The game will starts in %s seconds"
},
["blip_name"] = {
["Text"] = "King Of The Flag"
},
["storage_deposit"] = {
["Text"] = "Deposit"
},
["storage_withdraw"] = {
["Text"] = "Withdraw"
},
["no_winner"] = {
["Text"] = "No one"
},
["stash_help"] = {
["Text"] = "Deposit N %s"
},
["ui_winner"] = {
["Text"] = "Winner"
},
["ui_no_winner"] = {
["Text"] = "No one"
},
["open_deposit"] = {
["Text"] = "~INPUT_CONTEXT~ Open deposit"
},
["arrange_game"] = {
["Text"] = "~INPUT_CONTEXT~ Arrange game"
},
["ui_interact"] = {
["Text"] = "Interact KTF"
}
}This variable contains labels for different UI messages, such as "progress_locked" and "progress_unlocked." It likely corresponds to messages displayed to players.
Last updated