-- Permanent ban for cheating
local id = exports.jc_admin:BanPlayer(5, "Use of cheats", true)
-- Temporary ban until 12/31/2026, banned by admin with source 1
local id = exports.jc_admin:BanPlayer(5, "Repeated insults", false, "2026-12-31", 1)
-- Permanent ban from console/script (without admin)
local id = exports.jc_admin:BanPlayer(5, "Anticheat detected cheating", true, nil, 0)
local success = exports.jc_admin:UnbanPlayer(42)
-- Unban by registering the admin with source 1
local success = exports.jc_admin:UnbanPlayer(42, 1)
if success then
print("Player successfully unbanned")
else
print("Ban not found or error occurred")
end
RegisterCommand("playerperms", function(source, args, rawCommand)
local targetId = args[1] and tonumber(args[1])
if not targetId or targetId < 1 then
if source == 0 then
print("Usage: playerperms <player_id>")
elseif lib and lib.notify then
lib.notify({ title = "Player Perms", description = "Usage: /playerperms <player_id>", type = "error" })
end
return
end
local myGroup, myPerms = exports.jc_admin:GetPlayerGroupPermissions(source)
if source ~= 0 and (not myGroup or not myPerms) then
if lib and lib.notify then
lib.notify({ title = "Player Perms", description = "You don't have admin permissions", type = "error" })
end
return
end
local group, perms = exports.jc_admin:GetPlayerGroupPermissions(targetId)
local groupColor = group and exports.jc_admin:GetGroupColor(group) or nil
local playerName = GetPlayerName(targetId) or ("ID " .. tostring(targetId))
if not group then
local msg = ("Player %s (ID %s) has no admin group."):format(playerName, targetId)
print(msg)
if source ~= 0 and lib and lib.notify then
lib.notify({ title = "Player Perms", description = msg, type = "inform" })
end
return
end
local lines = {
("=== %s (ID %s) ==="):format(playerName, targetId),
("Group: %s"):format(group),
("Group color: %s"):format(groupColor or "—"),
"Permissions:"
}
local permKeys = {}
for k in pairs(perms) do
permKeys[#permKeys + 1] = k
end
table.sort(permKeys)
for _, key in ipairs(permKeys) do
local val = perms[key]
local granted = (val == true or val == "1" or val == 1)
lines[#lines + 1] = (" %s = %s"):format(key, granted and "yes" or tostring(val))
end
local fullText = table.concat(lines, "\n")
print(fullText)
if source ~= 0 then
if lib and lib.alertDialog then
lib.alertDialog(source, {
header = ("Perms: %s"):format(playerName),
content = fullText
})
elseif lib and lib.notify then
lib.notify({ title = "Player Perms", description = ("Group: %s | %d permissions (see console)"):format(group, #permKeys), type = "success" })
end
end
end, false)
exports.jc_admin:HasCommandPerm(source, permKey)
if exports.jc_admin:HasCommandPerm(source, "giveitem") then
print 'Give Item'
else
print 'You do not have permissions'
end
exports.jc_admin:IsPlayerAdmin(source)
if exports.jc_admin:IsPlayerAdmin(source) then
print 'Is Admin'
end