Config File
Last updated
Last updated
Config = {
Commands = {
ban = {list = "players", type = "banPlayer", description = "Ban a player using ban menu"},
kick = {list = "players", type = "kickPlayer", description = "Kick a player"},
warn = {list = "players", type = "warnPlayer", description = "Warn a player"},
comserve = {list = "players", type = "comsPlayer", description = "Comserve a player"},
unban = {list = "bans", type = "manageBans", description = "Unban a player"},
endcomserve = {list = "coms", type = "manageComs", description = "End comservation for a player"},
},
Permission = function(source, type) -- Type is the command type from above ("banPlayer", "kickPlayer", "warnPlayer", "comsPlayer", "manageBans", "manageComs")
if source == 0 then
return false -- server side txadmin cannot open menu
end
return IsPlayerAceAllowed(source, "ez_admin:"..type)
end,
Notify = function(message, type, source)
local title = "Success"
if type == "error" then
title = "Error"
end
if source then
if source == 0 then
print(message)
return
end
TriggerClientEvent('ez_admin:notify', source, title, message, 5000)
else
TriggerEvent('ez_admin:notify', title, message, 5000)
end
end,
BanChecks = {
ip = false, -- DO NOT USE IF YOU HAVE HIDDEN PLAYER IPS ON PLAYER CFX LIST
license = true, -- DO NOT DISABLE
discord = true,
}
}
Config.Coms = {
Location = {
coord = vector3(-589.46, -744.04, 36.28), -- The location of the comservation area
radius = 100, -- The radius of the comservation area
},
PenaltyIfLeft = 2, -- amount; How many amount to add to comservation amount if player leaves comservation area (default: 2)
Task = {
key = 38, -- control key; The key to press to do task (default: 38) | For RedM change to 0xCEFD9220
time = 5000, -- milliseconds; How long it takes to complete one task (default: 5000)
-- These are locations where to do task, renews every cycle (once all complete and amount still remaining)
-- Locations must be within the radius of the main area of coms
locations = {
{coord = vector3(-583.31, -746.43, 36.28),},
{coord = vector3(-596.68, -738.5, 36.29),},
{coord = vector3(-583.42, -732.26, 36.28),},
{coord = vector3(-600.5, -730.14, 36.29),},
{coord = vector3(-609.87, -744.08, 36.29),},
{coord = vector3(-603.58, -749.76, 36.29),},
{coord = vector3(-594.52, -749.54, 36.29),},
{coord = vector3(-585.26, -750.56, 36.28),},
},
playAnim = function()
RequestAnimDict("anim@amb@drug_field_workers@rake@male_a@base")
while not HasAnimDictLoaded("anim@amb@drug_field_workers@rake@male_a@base") do
Wait(100)
end
TaskPlayAnim(PlayerPedId(), "anim@amb@drug_field_workers@rake@male_a@base", "base", 8.0, 8.0, -1, 1, 0, false, false, false)
prop = CreateObject(GetHashKey("prop_tool_broom"), 0.0, 0.0, 0.0, true, true, true)
AttachEntityToEntity(prop, PlayerPedId(), GetPedBoneIndex(PlayerPedId(), 28422), 0.01, 0.04, -0.03, 0.0, 0.0, 0.0, true, true, false, true, 1, true)
end,
endAnim = function()
ClearPedTasks(PlayerPedId())
DeleteEntity(prop)
end,
whenPlayerClose = function(coord) -- Client side function what to do when player close to task location
local onScreen, _x, _y = World3dToScreen2d(coord.x, coord.y, coord.z)
if onScreen then
SetTextScale(0.35, 0.35)
SetTextFont(4)
SetTextProportional(1)
SetTextColour(255, 255, 255, 215)
SetTextDropShadow(0, 0, 0, 55)
SetTextEdge(0, 0, 0, 150)
SetTextDropShadow()
SetTextOutline()
SetTextEntry("STRING")
SetTextCentre(1)
AddTextComponentString("[E] to clean")
DrawText(_x,_y)
end
end,
drawMarker = function(coord) -- Client side function to draw marker, Delete code inside if not wanted
DrawMarker(27, coord.x, coord.y, coord.z-0.9, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 255, 0, 0, 100, false, true, 2, nil, nil, nil, false)
end,
rubbishProp = "proc_litter_01", -- Optional: Redm p_cs_sackcorn01x | Fivem proc_litter_01
},
}
--[[Config.Coms = {
Location = {
coord = vector3(2591.01, -1201.96, 53.91), -- The location of the comservation area
radius = 100, -- The radius of the comservation area
},
PenaltyIfLeft = 2, -- amount; How many amount to add to comservation amount if player leaves comservation area (default: 2)
Task = {
key = 0x760A9C6F, -- control key; The key to press to do task (default is E: 38) | For RedM G change to 0x760A9C6F
time = 5000, -- milliseconds; How long it takes to complete one task (default: 5000)
-- These are locations where to do task, renews every cycle (once all complete and amount still remaining)
-- Locations must be within the radius of the main area of coms
locations = {
{coord = vector3(2583.0518, -1213.4706, 53.9251),},
{coord = vector3(2566.5381, -1218.7795, 53.9038),},
{coord = vector3(2556.7456, -1210.8679, 53.9088),},
{coord = vector3(2554.3701, -1199.9381, 53.9085),},
{coord = vector3(2560.0305, -1189.8553, 53.9110),},
{coord = vector3(2574.0483, -1185.9275, 53.9064),},
{coord = vector3(2567.7224, -1197.0154, 53.9095),},
{coord = vector3(2574.1316, -1206.5809, 53.9078),},
},
playAnim = function()
TaskStartScenarioInPlace(PlayerPedId(), "WORLD_HUMAN_STRAW_BROOM_WORKING", 10, true)
end,
endAnim = function()
ClearPedTasks(PlayerPedId())
end,
whenPlayerClose = function(coord) -- Client side function what to do when player close to task location
local onScreen, _x, _y = GetScreenCoordFromWorldCoord(coord.x, coord.y, coord.z)
if onScreen then
SetTextScale(0.35, 0.35) -- Adjust scale for readability
SetTextFontForCurrentCommand(1) -- Default font, adjust as needed
SetTextColor(255, 255, 255, 215) -- White text
SetTextCentre(1) -- Center the text
DisplayText(CreateVarString(10, "LITERAL_STRING", "[G] to clean"), _x, _y)
end
end,
drawMarker = function(coord) -- Client side function to draw marker, Delete code inside if not wanted
DrawMarker(0x94FDAE17, coord.x, coord.y, coord.z-0.9, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 255, 0, 0, 100, false, true, 2, nil, nil, nil, false)
end,
rubbishProp = "new_p_litternbx02x_static", -- Optional: Redm p_cs_sackcorn01x | Fivem proc_litter_01
},
}]]
Language = {
general = {
warnedBy = "Warned by %s",
},
success = {
ban = "Player banned successfully!",
unban = "Player unbanned successfully!",
kick = "Player kicked successfully!",
coms = "Player given Community Service successfully!",
warn = "Player warned successfully!",
endcoms = "Community Service ended successfully!",
},
error = {
unban = "Failed to unban player!",
invalidBanId = "Invalid ban id!",
alreadyComs = "Player is already serving!",
invalidComsId = "Invalid comserve id!",
}
}