event Action? OnSimpleAdminReadyUsed by: FunCommands, ExampleModule
The public API in
CS2-SimpleAdminApi/,
generated from the source at build time: signatures as written, with their /// documentation.
Get the API with the simpleadmin:api plugin capability; see Modules for a
working module. Menus are passed around as object: create them with the API and pass them back
to it (AddMenuOption, AddSubMenu, OpenMenu).
“Used by” names the modules in this repository that call a member, as examples to read.
event Action? OnSimpleAdminReadyUsed by: FunCommands, ExampleModule
event Action<PlayerInfo, PlayerInfo?, PenaltyType, string, int, int?, int?>? OnPlayerPenaltiedEvent fired when a player receives a penalty.
Used by: BanSoundModule, ExampleModule
event Action<SteamID, PlayerInfo?, PenaltyType, string, int, int?, int?>? OnPlayerPenaltiedAddedEvent fired when a penalty is added to a player by SteamID.
Used by: ExampleModule
event Action<string, string?, bool, object>? OnAdminShowActivityEvent to show admin activity messages.
Used by: RedisInform
event Action<int, bool>? OnAdminToggleSilentEvent fired when an admin toggles silent mode.
Used by: StealthModule
PlayerInfo GetPlayerInfo(CCSPlayerController player)Gets player information associated with the specified player controller.
playerUsed by: FunCommands, ExampleModule
Dictionary<PenaltyType, List<(DateTime EndDateTime, int Duration, bool Passed)>> GetPlayerMuteStatus(CCSPlayerController player)Returns mute-related penalties for the specified player.
playervoid IssuePenalty(CCSPlayerController player, CCSPlayerController? admin, PenaltyType penaltyType, string reason, int duration = -1)Issues a penalty to a player controller with specified type, reason, and optional duration.
Used by: AntiDLL, ExampleModule
void IssuePenalty(SteamID steamid, CCSPlayerController? admin, PenaltyType penaltyType, string reason, int duration = -1)Issues a penalty to a player identified by SteamID with specified type, reason, and optional duration.
Used by: AntiDLL, ExampleModule
TargetResult? GetTarget(CommandInfo command)Gets target players from command
Used by: FunCommands
List<CCSPlayerController> GetValidPlayers()Returns the list of current valid players, available to call from other plugins.
Used by: FunCommands, ExampleModule
string GetConnectionString()Returns the database connection string used by the plugin.
Used by: ExampleModule
string GetServerAddress()Returns the configured server IP address with port.
Used by: ExampleModule
int? GetServerId()Returns the internal server ID assigned in the plugin's database.
Used by: ExampleModule
void LogCommand(CCSPlayerController? caller, string command)Logs a command invoked by a caller with the command string.
Used by: FunCommands
void LogCommand(CCSPlayerController? caller, CommandInfo command)Logs a command invoked by a caller with the command info object.
Used by: FunCommands
void ShowAdminActivity(string messageKey, string? callerName = null, bool dontPublish = false, params object[] messageArgs)Shows an admin activity message, optionally suppressing broadcasting.
Used by: FunCommands, RedisInform
void ShowAdminActivityTranslated(string translatedMessage, string? callerName = null, bool dontPublish = false)Shows an admin activity message with a custom translated message (for modules with their own localizer).
translatedMessagecallerNamedontPublishvoid ShowAdminActivityLocalized(object moduleLocalizer, string messageKey, string? callerName = null, bool dontPublish = false, params object[] messageArgs)Shows an admin activity message using module's localizer for per-player language support. This method sends messages in each player's configured language.
moduleLocalizermessageKeycallerNamedontPublishmessageArgsUsed by: FunCommands
bool IsAdminSilent(CCSPlayerController player)Returns true if the specified admin player is in silent mode (not broadcasting activity).
Used by: FunCommands, StealthModule, ExampleModule
HashSet<int> ListSilentAdminsSlots()Returns a set of player slots representing admins currently in silent mode.
Used by: StealthModule
void RegisterCommand(string name, string? description, CommandInfo.CommandCallback callback)Registers a new command with the specified name, description, and callback.
Used by: FunCommands
void UnRegisterCommand(string name)Unregisters an existing command by its name.
Used by: FunCommands
class MenuContextProvides contextual information about a menu to its factory function. This eliminates the need to duplicate category IDs and menu titles when creating menus.
| Member | Description |
|---|---|
string CategoryId | The category ID this menu belongs to (e.g., "fun", "players"). Used for automatic "Back" button navigation. |
string MenuId | The unique identifier for this menu within its category. |
string MenuTitle | The display title of the menu (from registration). |
string? Permission | The permission required to access this menu (if any). |
string? CommandName | The command name for permission override checking (if any). |
MenuContext(string categoryId, string menuId, string menuTitle, string? permission = null, string? commandName = null) | Creates a new MenuContext with the specified values. |
CategoryId = categoryId | |
MenuId = menuId | |
MenuTitle = menuTitle | |
Permission = permission | |
CommandName = commandName |
enum PenaltyTypeBan = 0,
Kick,
Mute,
Gag,
Silence,
Warnclass PlayerInfoPlayerInfo(
int? userId,
int slot,
SteamID steamId,
string name,
string? ipAddress,
int totalBans = 0,
int totalMutes = 0,
int totalGags = 0,
int totalSilences = 0,
int totalWarns = 0
)| Member | Description |
|---|---|
int? UserId | |
int Slot | |
SteamID SteamId | |
string Name | |
string? IpAddress | |
int TotalBans | |
int TotalMutes | |
int TotalGags | |
int TotalSilences | |
int TotalWarns | |
bool WaitingForKick | |
List<(ulong SteamId, string PlayerName)> AccountsAssociated | |
DiePosition? DiePosition | |
bool IsLoaded |
class DiePositionDiePosition(
Vector3 position,
Vector3 angle
)| Member | Description |
|---|---|
Vector3 Position | |
Vector3 Angle |