Enums 5

Enum Description
Address

APLRes

FeatureStatus

Feature statuses.

FeatureType

Feature types.

NumberType

Represents how many bytes we can read from an address with one load

Forwards 16

Function Description
AskPluginLoad

AskPluginLoad2

Called before OnPluginStart, in case the plugin wants to check for load failure. This is called even if the plugin type is "private." Any natives from modules are not available at this point. Thus, this forward should only be used for explicit pre-emptive things, such as adding dynamic natives, setting certain types of load filters (such as not loading the plugin for certain games).

OnAllPluginsLoaded

Called after all plugins have been loaded. This is called once for every plugin. If a plugin late loads, it will be called immediately after OnPluginStart().

OnAutoConfigsBuffered

This is called once, right after OnMapStart() but any time before OnConfigsExecuted(). It is called after the "exec sourcemod.cfg" command and all AutoExecConfig() exec commands have been added to the ServerCommand() buffer.

OnClientFloodCheck

Called when a client has sent chat text. This must return either true or false to indicate that a client is or is not spamming the server.

OnClientFloodResult

Called after a client's flood check has been computed. This can be used by antiflood algorithms to decay/increase flooding weights.

OnConfigsExecuted

Called when the map has loaded, servercfgfile (server.cfg) has been executed, and all plugin configs are done executing. This is the best place to initialize plugin functions which are based on cvar data.

OnGameFrame

Called before every server frame. Note that you should avoid doing expensive computations or declaring large local arrays.

OnLibraryAdded

Called after a library is added that the current plugin references optionally. A library is either a plugin name or extension name, as exposed via its include file.

OnLibraryRemoved

Called right before a library is removed that the current plugin references optionally. A library is either a plugin name or extension name, as exposed via its include file.

OnMapEnd

Called right before a map ends.

OnMapStart

Called when the map is loaded.

OnPluginEnd

Called when the plugin is about to be unloaded.

OnPluginPauseChange

Called when the plugin's pause status is changing.

OnPluginStart

Called when the plugin is fully initialized and all known external references are resolved. This is only called once in the lifetime of the plugin, and is paired with OnPluginEnd().

OnServerCfg

Functions 29

Function Description
AutoExecConfig

Specifies that the given config file should be executed after plugin load. OnConfigsExecuted() will not be called until the config file has executed, but it will be called if the execution fails.

CanTestFeatures

Returns whether "GetFeatureStatus" will work. Using this native or this function will not cause SourceMod to fail loading on older versions, however, GetFeatureStatus will only work if this function returns true.

FindPluginByNumber

Finds a plugin by its order in the list from the "plugins list" server "sm" command. You should not use this function to loop through all plugins, use the iterator instead. Looping through all plugins using this native is O(n^2), whereas using the iterator is O(n).

FormatTime

Produces a date and/or time string value for a timestamp.

GameConfGetAddress

Finds an address calculation in a GameConfig file, performs LoadFromAddress on it as appropriate, then returns the final address.

GameConfGetKeyValue

Gets the value of a key from the "Keys" section.

GameConfGetOffset

Returns an offset value.

GetExtensionFileStatus

Returns the status of an extension, by filename.

GetFeatureStatus

Returns whether a feature exists, and if so, whether it is usable.

GetMyHandle

Returns the calling plugin's Handle.

GetPluginFilename

Retrieves a plugin's file name relative to the plugins folder.

GetPluginInfo

Retrieves a plugin's public info.

GetPluginIterator

Returns an iterator that can be used to search through plugins.

GetPluginStatus

Returns a plugin's status.

GetSysTickCount

Returns the operating system's "tick count," which is a number of milliseconds since the operating system loaded. This can be used for basic benchmarks.

GetTime

Gets the system time as a unix timestamp.

IsPluginDebugging

Retrieves whether or not a plugin is being debugged.

LibraryExists

Returns whether a library exists. This function should be considered expensive; it should only be called on plugin to determine availability of resources. Use OnLibraryAdded()/OnLibraryRemoved() to detect changes in optional resources.

LoadFromAddress

Load up to 4 bytes from a memory address.

LoadGameConfigFile

Loads a game config file.

MorePlugins

Returns whether there are more plugins available in the iterator.

ReadMapList

Loads a map list to an ADT Array.

ReadPlugin

Returns the current plugin in the iterator and advances the iterator.

RegPluginLibrary

Registers a library name for identifying as a dependency to other plugins.

RequireFeature

Requires that a given feature is available. If it is not, SetFailState() is called with the given message.

SetFailState

Causes the plugin to enter a failed state. An error will be thrown and the plugin will be paused until it is unloaded or reloaded.

SetMapListCompatBind

Makes a compatibility binding for map lists. For example, if a function previously used "clam.cfg" for map lists, this function will insert a "fake" binding to "clam.cfg" that will be overridden if it's in the maplists.cfg file.

StoreToAddress

Store up to 4 bytes to a memory address.

ThrowError

Aborts the current callback and throws an error. This function does not return in that no code is executed following it.