Bans

Ban-related functions and listeners.

Summary
BansBan-related functions and listeners.
Functions
banBans a user.
kickbanAn alias for ban.
addBanHelper function to store additional data about bans.
unbanUnbans the given steamid.
getLegacyBansReturns bans written by ULib versions prior to 2.7.
refreshBansRefreshes the ULib bans.

Functions

ban

function ULib.ban(ply,
time,
reason,
admin)

Bans a user.

Parameters

plyThe player to ban.
time(Optional) The time in minutes to ban the person for, leave nil or 0 for permaban.
reason(Optional) The reason for banning
admin(Optional) Admin player enacting ban

Revisions

v2.10Added support for custom ban list

kickban

ULib.kickban = ULib.ban

An alias for ban.

addBan

function ULib.addBan(steamid,
time,
reason,
name,
admin)

Helper function to store additional data about bans.

Parameters

steamidBanned player’s steamid
timeLength of ban in minutes, use 0 for permanant bans
reason(Optional) Reason for banning
name(Optional) Name of player banned
admin(Optional) Admin player enacting the ban

Revisions

2.10Initial
2.40If the steamid is connected, kicks them with the reason given

unban

function ULib.unban(steamid,
admin)

Unbans the given steamid.

Parameters

steamidThe steamid to unban.
admin(Optional) Admin player unbanning steamid

Revisions

v2.10Initial

getLegacyBans

function ULib.getLegacyBans()

Returns bans written by ULib versions prior to 2.7.

refreshBans

function ULib.refreshBans()

Refreshes the ULib bans.

function ULib.ban(ply,
time,
reason,
admin)
Bans a user.
ULib.kickban = ULib.ban
An alias for ban.
function ULib.addBan(steamid,
time,
reason,
name,
admin)
Helper function to store additional data about bans.
function ULib.unban(steamid,
admin)
Unbans the given steamid.
function ULib.getLegacyBans()
Returns bans written by ULib versions prior to 2.7.
function ULib.refreshBans()
Refreshes the ULib bans.
Close