FXServer Integration
Moderation Exports
Methods for moderating players and reviewing moderation actions.
Ban exports
recentBans
Retrieves a list of recent bans.
Parameters:
Prop
Type
local options = {
page = 1;
pageSize = 5;
}
local result = exports.fxmanager:recentBans(options)
if result.ok then
for _, ban in ipairs(result.data) do
print("Bane (".. ban.id ..") Player: " .. ban.name .. " - " .. ban.reason)
end
else
print("Failed to fetch bans: " .. result.error)
end
searchBans
Parameters:
Prop
Type
local query = "Andreutu"
local options = {
page = 1;
pageSize = 5;
}
local result = exports.fxmanager:searchBans(query, options)
if result.ok then
for _, ban in ipairs(result.data) do
print("Ban (".. ban.id ..") Player: " .. ban.name .. " - " .. ban.reason)
end
else
print("Failed to searcg for bans: " .. result.error)
end
ban
Payload:
Prop
Type
local target = { serverId = 1 }
local reason = "No reason provided"
local expiresAt = nil
local durationSeconds = nil
local by = 1
local response = exports.fxManager:ban(target, reason, expiresAt, durationSeconds, by)
if response.ok then
print("Ban successful, banId:", response.data.banId)
else
print("Unable to ban:", response.error)
endHere is the complete documentation block for the revokeBan export, maintaining the exact layout, component syntax, and compilation-safe JSX formatting used in your ban example.
revokeBan
Parameters:
Prop
Type
local banId = 42
local options = {
by = 1
}
local response = exports.fxManager:revokeBan(banId, options)
if response.ok then
print("Ban successfully revoked, banId:", response.data.banId)
else
print("Unable to revoke ban:", response.error)
end
Kick exports
kick
Payload:
Prop
Type
local payload = {
target = { serverId = 1 },
reason = "Exploiting game mechanics",
by = 1
}
local response = exports.fxManager:kick(payload)
if response.ok then
print("Player successfully kicked")
else
print("Unable to kick player:", response.error)
endWarn exports
warnPlayer
Payload:
Prop
Type
local payload = {
target = { serverId = 1 },
reason = "Exploiting game mechanics",
by = 1
}
local response = exports.fxManager:warnPlayer(payload)
if response.ok then
print("Player successfully warned")
else
print("Unable to warn player:", response.error)
end