The Ban command bans players and lifts bans. /ban add <target or SteamID> <duration> [reason] bans the targeted players for a duration such as 30 (minutes), "2 hours" or perma, with an optional reason, and kicks them. Given a SteamID that belongs to nobody on the server, it bans that SteamID, whether its owner has ever joined or not. /ban remove <SteamID> lifts the ban of a SteamID. Both need the ban permission.

ban add finds its targets itself instead of setting immunity, because the command interpreter only knows the players who are on the server.

Summary

Subcommands

Bans the targeted players, or the SteamID of somebody who is not on the server, for the given duration and notifies staff.
Lifts the ban on a SteamID, typed in any case and with any universe digit, and notifies staff, or tells the caller that it is not banned.

Subcommands

add:on_run(actor, target, duration, reason)

shared plugins/admin/plugin/commands/sh_ban.lua:35

Bans the targeted players, or the SteamID of somebody who is not on the server, for the given duration and notifies staff. A duration of 0 is a permanent ban and is announced as one; a negative duration, or one that would end the ban after the year 9999, is refused. The caller needs a higher immunity than every target: for a SteamID that goes by the role stored for it, and a SteamID from the root_steamid config can only be banned by a root player or from the server console.

Parameters

  • actor Player the caller, or an invalid entity when run from the server console
  • target String exact player name, target selector or SteamID
  • duration String ban length as read by Bolt:interpret_ban_time, e.g. '30' or 'perma'
  • reason String optional, defaults to nil the ban reason, as it was typed

remove:on_run(actor, steam_id)

shared plugins/admin/plugin/commands/sh_ban.lua:90

Lifts the ban on a SteamID, typed in any case and with any universe digit, and notifies staff, or tells the caller that it is not banned.

Parameters

  • actor Player the caller, or an invalid entity when run from the server console
  • steam_id String SteamID to unban

Defined in