Skip to content

Admin Control

Christian Petersen edited this page Feb 10, 2017 · 3 revisions

The admin control interface allows plugins to execute administrative actions given a player who has the right to perform them.

Reserved slots

Reserved slots allow you to make a number of slots in the server's list of players reserved. When all non-reserved slots have been filled, any players connecting will only be allowed to continue connecting if they pass a check performed by the CanPlayerUseReservedSlot hook.

This hook has the following syntax:

HookReturnCode CanPlayerUseReservedSlot( edict_t@ pEntity, const string& in szPlayerName, const string& in szIPAddress, bool& out bCanJoin )

Plugins implementing this hook can reject players by setting bCanJoin to false, and allow them to continue joining by setting it to true. This argument defaults to false, so you must set it to true explicitly if you want to allow them to join.

Methods affecting players

These methods affect players. There are variants to automatically verify the admin level of the invoking player, and variants to simply execute the action without any verification.

Kill Player

Kill the target player. Can optionally specify a custom respawn time.

Kick Player

Kick the target player from the server. The player is also temporarily banned. Can either specify a custom ban time (in minutes), or the mp_kickbantime cvar is used.

Ban Player

Bans the target player from the server. The player is also kicked from the server. Can either specify a custom ban time (in minutes), or the mp_bantime cvar is used.

Slap Player

Slaps the target player. Can specify how much damage is applied. Can optionally specify slap direction and velocity and damage type(s).

Clone this wiki locally