Table of Contents

Interface IPlugin

Namespace
CounterStrikeSharp.API.Core
Assembly
CounterStrikeSharp.API.dll

Interface which every CounterStrikeSharp plugin must implement. Module will be created with parameterless constructor and then Load method will be called.

public interface IPlugin : IDisposable
Inherited Members

Properties

CommandManager

ICommandManager CommandManager { get; set; }

Property Value

ICommandManager

Localizer

IStringLocalizer Localizer { get; set; }

Property Value

IStringLocalizer

Logger

ILogger Logger { get; set; }

Property Value

ILogger

ModuleAuthor

Author of the plugin as it will appear in the plugin list.

string ModuleAuthor { get; }

Property Value

string

ModuleDescription

Brief description of the plugin as it will appear in the plugin list.

string ModuleDescription { get; }

Property Value

string

ModuleName

Name of the plugin as it will appear in the plugin list.

string ModuleName { get; }

Property Value

string

ModulePath

The path to the plugin's DLL file.

string ModulePath { get; }

Property Value

string

ModuleVersion

Module version as it will appear in the plugin list.

string ModuleVersion { get; }

Property Value

string

Methods

InitializeConfig(object, Type)

void InitializeConfig(object instance, Type pluginType)

Parameters

instance object
pluginType Type

Load(bool)

This method is called by CounterStrikeSharp on plugin load and should be treated as plugin constructor. Called with true on a hot reload (DLL file replaced in plugins folder)

void Load(bool hotReload)

Parameters

hotReload bool

OnAllPluginsLoaded(bool)

Will be called by CounterStrikeSharp after all plugins have been loaded. This will also be called for convenience after a reload or a late l oad, so that you don't have to handle re-wiring everything.

void OnAllPluginsLoaded(bool hotReload)

Parameters

hotReload bool

RegisterAllAttributes(object)

void RegisterAllAttributes(object instance)

Parameters

instance object

Unload(bool)

Will be called by CounterStrikeSharp on plugin unload. In this method the plugin should cleanup any extra resources. Event handlers, listeners etc. will automatically be deregistered.

void Unload(bool hotReload)

Parameters

hotReload bool