Config

-- Enable debug make sure FiveM client is "Beta Channel" in setting to use more dev command.
Config.Debug = false

Config.MinPlayers = 2 -- Minimum of player to allow counwdown (Set to 1, Trial mode will enable).
Config.MaxPlayers = 20 -- Maximum player allow in lobby.
Config.LobbyTime = 20 -- Countdown timer to start race if minimum player reached Config.MinPlayers. (second)
Config.ArenaTime = 10 -- Duration in game before lobby auto close. (minute)
Config.OwnWorld = true -- Game in another world. Participants and the non participants will not see each other.

Config.Game.PrepareGameDuration = 30 -- Duration before game start after lobby countdown. (second)
Config.Game.PrepareRoundDuration = 10 -- Duration before round start after round end (second)
Config.Game.RespawnDuration = 4 -- Respawn countdown timer (second)
Config.Game.KillStreakDuration = 7 -- Duration before lost kill streak (second)

Config.Game.Team.ChangeCooldown = 20 -- Cooldown after changing team (second)

---Control behavior of buy menu
---@param currentMap string map name
---@param weaponMode string
Config.Game.OpenWeaponSelectMenu = function(currentMap, weaponMode) -- Weapon but menu.
	---@ammo integer Ammo to give with weapon.
	---@infinite boolean Infinite ammo of gived weapon.
	---@removetype table Remove weapon category in list from buy menu.
	if currentMap == "awp_india" then
		TriggerEvent("weaponselecter:setmoney", 5000) -- Starting money.
		TriggerEvent("weaponselecter:open", {ammo=200, infinite=true, removetype={"pistol", "submachine", "assault", "shotgun", "melee", "tool", "grenade"}})
	else
		if weaponMode == "all" then
			TriggerEvent("weaponselecter:setmoney", 5000)
			TriggerEvent("weaponselecter:open", {ammo=200, infinite=true, removetype={"melee", "tool", "grenade"}})
		elseif weaponMode == "melee" then
			TriggerEvent("weaponselecter:setmoney", 200)
			TriggerEvent("weaponselecter:open", {ammo=200, infinite=true, removetype={"pistol", "submachine", "assault", "shotgun", "sniper", "tool", "grenade"}})
		elseif weaponMode == "pistol" then
			TriggerEvent("weaponselecter:setmoney", 1000)
			TriggerEvent("weaponselecter:open", {ammo=200, infinite=true, removetype={"submachine", "assault", "shotgun", "sniper", "melee", "tool", "grenade"}})
		elseif weaponMode == "submachine" then
			TriggerEvent("weaponselecter:setmoney", 2000)
			TriggerEvent("weaponselecter:open", {ammo=200, infinite=true, removetype={"pistol", "assault", "shotgun", "sniper", "melee", "tool", "grenade"}})
		elseif weaponMode == "assault" then
			TriggerEvent("weaponselecter:setmoney", 4000)
			TriggerEvent("weaponselecter:open", {ammo=200, infinite=true, removetype={"pistol", "submachine", "shotgun", "sniper", "melee", "tool", "grenade"}})
		elseif weaponMode == "shotgun" then
			TriggerEvent("weaponselecter:setmoney", 2000)
			TriggerEvent("weaponselecter:open", {ammo=200, infinite=true, removetype={"pistol", "submachine", "assault", "sniper", "melee", "tool", "grenade"}})
		elseif weaponMode == "sniper" then
			TriggerEvent("weaponselecter:setmoney", 5000)
			TriggerEvent("weaponselecter:open", {ammo=200, infinite=true, removetype={"pistol", "submachine", "assault", "shotgun", "melee", "tool", "grenade"}})
		end
	end
end

-- Config.XP : Display XP rank system on end screen.
-- Example is https://github.com/chaixshot/DarkRP_XP

local DarkRP_XP = exports["DarkRP_XP"]

Config.EndScreen.ResultsPanelTime = 10 -- sec
Config.EndScreen.XP.rankTextSmall = "LEVEL UP"
Config.EndScreen.XP.rankTextBig = "~b~Nice~s~"

Config.EndScreen.XP.GetXpGained = function(source, exp)
	exp = math.floor(exp)
	if GetResourceState("DarkRP_XP") == "started" then -- DarkRP_XP request.
		DarkRP_XP:AddPlayerXPToServer(exp)
		return exp
	else
		return 0
	end
end

-- Current XP in rank system.
Config.EndScreen.XP.GetXpBeforeGain = function(source)
	if GetResourceState("DarkRP_XP") == "started" then -- DarkRP_XP request.
		return DarkRP_XP:GetCurrentPlayerXP()
	else
		return 0
	end
end

-- Minimum XP of current rank.
Config.EndScreen.XP.GetMinLevelXP = function(source)
	if GetResourceState("DarkRP_XP") == "started" then -- DarkRP_XP request.
		return DarkRP_XP:GetXPCeilingForLevel(DarkRP_XP:GetCurrentPlayerLevel()-1)
	else
		return 0
	end
end

-- Maximum XP of current rank.
Config.EndScreen.XP.GetMaxLevelXP = function(source)
	if GetResourceState("DarkRP_XP") == "started" then -- DarkRP_XP request.
		return DarkRP_XP:GetXPCeilingForLevel(DarkRP_XP:GetCurrentPlayerLevel())
	else
		return 0
	end
end

-- Current rank.
Config.EndScreen.XP.GetCurrentRank = function(source)
	if GetResourceState("DarkRP_XP") == "started" then -- DarkRP_XP request.
		return DarkRP_XP:GetCurrentPlayerLevel()
	else
		return 1
	end
end

-- Rank next from current rank.
Config.EndScreen.XP.GetNextRank = function(source)
	if GetResourceState("DarkRP_XP") == "started" then -- DarkRP_XP request.
		return DarkRP_XP:GetCurrentPlayerLevel()+1
	else
		return 1
	end
end

Config.EndScreen.Money.Text = { -- Display money on end screen.
	topText = "",
	bottomText = "",
	rightHandStat = "",
	rightHandStatIcon = 3, --0 or 1 = checked, 2 = X, 3 = no icon
}

--- Map coords for custom map
Config.Location["cs_italy"] = {
	["mapObj"] = "cs_italy", -- .ydr model to spawn as a map, remove the line if not have.
	["spawnblue"] = {-- Random spawn point of blue team
		{x=1835.401, y=2723.904, z=114.787},
		{x=1826.954, y=2727.675, z=116.705},
		{x=1823.932, y=2721.265, z=116.688},
		{x=1831.562, y=2718.408, z=114.787},
		{x=1832.757, y=2729.151, z=114.787},
	},
	["spawnred"] = {-- Random spawn point of red team
		{x=1864.938, y=2812.522, z=119.971},
		{x=1865.075, y=2812.576, z=122.73},
		{x=1864.494, y=2808.501, z=122.736},
		{x=1867.777, y=2805.024, z=122.736},
		{x=1867.435, y=2805.565, z=119.971},
	},
	["random"] = {-- Random spawn point
		{x=1833.483, y=2726.529, z=114.784},
		{x=1821.628, y=2762.245, z=116.515},
		{x=1815.355, y=2760.318, z=122.908},
		{x=1824.992, y=2782.227, z=116.515},
		{x=1849.633, y=2777.395, z=116.515},
		{x=1858.632, y=2747.969, z=116.515},
		{x=1841.52, y=2739.687, z=116.685},
		{x=1868.853, y=2777.728, z=115.783},
		{x=1860.727, y=2791.052, z=121.008},
		{x=1861.648, y=2808.028, z=119.971},
		{x=1860.135, y=2810.139, z=122.736},
		{x=1852.613, y=2807.012, z=119.971},
		{x=1844.658, y=2797.53, z=116.504},
		{x=1829.138, y=2775.487, z=123.421},
		{x=1839.144, y=2775.38, z=120.126},
		{x=1834.302, y=2768.933, z=120.144},
		{x=1824.837, y=2722.677, z=116.688},
		{x=1823.066, y=2750.444, z=116.688},
		{x=1868.895, y=2759.238, z=116.688},
		{x=1851.384, y=2768.39, z=116.697},
		{x=1822.104, y=2798.137, z=116.688},
		{x=1838.065, y=2806.249, z=116.688},
		{x=1834.28, y=2806.682, z=120.144},
		{x=1839.05, y=2775.465, z=120.144},
		{x=1833.951, y=2759.095, z=119.28},
	}
}

Last updated