CounterStrikeSharp.API
Returns the API version of CounterStrikeSharp running on the server
Indicates that the parameter should be pulled from the ScriptContext as the passed in type,
then cast/converted to the parameter type.
API version that this plugin requires to work correctly.
Registers a game event handler.
The type of the game event.
The event handler to register.
The mode in which the event handler is hooked. Default is `HookMode.Post`.
Registers a new server command.
The name of the command.
The description of the command.
The callback function to be invoked when the command is executed.
Registers all game event handlers that are decorated with the `[GameEventHandler]` attribute.
The instance of the object where the event handlers are defined.
Serializable instance of the CoreConfig
Configuration related to the Core API.
List of characters to use for public chat triggers.
List of characters to use for silent chat triggers.
Per , certain plugin
functionality will trigger all of the game server owner's Game Server Login Tokens
(GSLTs) to get banned when executed on a Counter-Strike 2 game server.
Enabling this option will block plugins from using functionality that is known to cause this.
Note that this does NOT guarantee that you cannot
receive a ban.
Disable this option at your own risk.
Specifies the hook mode.
The hook is called before the original method.
The hook is called after the original method.
Represents the result of a hook.
Continue processing the hook to other listeners.
The hook result has been changed. Currently unused.
The hook has been handled. The original method will not be called, but other hooks will still be called.
Stop processing the hook. The original method will not be called, and other hooks will not proceed after this one.
Interface which every CounterStrikeSharp plugin must implement. Module will be created with parameterless constructor and then Load method will be called.
Name of the plugin.
Module version.
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)
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.
An interface that describes a plugin configuration.
Called when an entity is spawned.
The spawned entity.
Called when an entity is created.
The created entity.
Called when an entity is deleted.
The deleted entity.
Called when an entity's parent is changed.
The entity whose parent was changed.
The new parent entity.
Called on every server tick (64 per second).
This handler should avoid containing expensive operations.
Called when a new map is loaded.
The name of the map that was started.
Called when the current map is about to end.
Called when a client connects to the server.
The player slot of the connected client.
The name of the connected client.
The IP address of the connected client.
Called when a client connects to the server.
The player slot of the connected client.
Called when a client is entering the game.
The player slot of the client.
Called when a client disconnects from the server.
The player slot of the disconnected client.
Called after a client has disconnected from the server.
The player slot of the disconnected client.
Called when a client has been authorized by Steam.
The player slot of the authorized client.
The Steam ID of the authorized client.
Called when the server is updating the hibernation state.
if the server is hibernating, otherwise
Called when the Steam API is activated.
Called when the Steam API is deactivated.
Called when the server has changed hostname.
New hostname of the server
Shorthand for accessing an entity's CBodyComponent?.SceneNode?.AbsOrigin;
Shorthand for accessing an entity's CBodyComponent?.SceneNode?.AbsRotation;
Forcibly switches the team of the player, the player will remain alive and keep their weapons.
The team to switch to
Switches the team of the player, has the same effect as the "jointeam" console command.
This follows gamemode rules, so this will usually cause a player suicide/loss of weapons.
The team to change to
Gets the active pawns button state. Will work even if the player is dead or observing.
Grabs the admin data for a player that was loaded from "configs/admins.json".
SteamID object of the player.
AdminData class if data found, null if not.
Checks to see if a player has access to a certain set of permission flags.
Player or server console.
Flags to look for in the players permission flags.
True if flags are present, false if not.
Checks to see if a player has access to a certain set of permission flags.
Steam ID object.
Flags to look for in the players permission flags.
True if flags are present, false if not.
Temporarily adds a permission flag to the player. These flags are not saved to
"configs/admins.json".
Player controller to add a flag to.
Flags to add for the player.
Temporarily adds a permission flag to the player. These flags are not saved to
"configs/admins.json".
SteamID to add a flag to.
Flags to add for the player.
Temporarily removes a permission flag to the player. These flags are not saved to
"configs/admins.json".
Player controller to remove flags from.
Flags to remove from the player.
Temporarily removes a permission flag to the player. These flags are not saved to
"configs/admins.json".
Steam ID to remove flags from.
Flags to remove from the player.
Removes a players admin data. This is not saved to "configs/admins.json"
Player controller to remove admin data from.
Removes a players admin data. This is not saved to "configs/admins.json"
Steam ID remove admin data from.
The minimum amount of arguments required to execute this command.
If the command fails, this string is printed to the caller to show the CommandUtils intended usage.
Restricts the command so it can only be executed by players, the server console, or both (see CommandUsage).
The underlying data type of the ConVar.
The ConVar flags as defined by .
Used to access primitive value types, i.e. , , , etc.
The type of value to retrieve
Used to access reference value types, i.e. Vector, QAngle
String value of the ConVar.
String is a special exception as we have to marshal the string to UTF8 on the send/receive to unmanaged code.
Shorthand for checking the flag.
Finds a ConVar by name.
Reads a string from the specified pointer, class name, and member name.
These are for non-networked strings, which are just stored as raw char bytes on the server.
Reads a UTF8 encoded string from the specified pointer, class name, and member name.
These are for networked strings, which need to be read differently.
A Angle object represents 3D Euler angle, offset from the cardinal Z axis.
Each angle contains three rotation values.
- Xpitch +down/-up
- Yyaw +left/-right
- Zroll +right/-left
Creates new angle with the supplied Pitch, Yaw and Roll values.
Pitch
Yaw
Roll
Pitch of angle
Yaw of angle
Roll of angle
Pitch of angle
Roll of angle
Pitch of angle
Yaw of angle
Roll of angle
A Vector object represents a line with a direction and length.
Each vector contains three co-ordinates:
- X+forward/-backward
- Y+left/-right
- Z+up/-down
Returns a copy of the vector with values replaced.
X value to replace with
Y value to replace with
Z value to replace with
Copy of vector
Adds values of argument vector to the original vector. Does not create a new vector object, skipping object construction.
Returns an angle that represents the normal of the vector.
Returns the angle of the vector, but allows the use of a different 'up' direction.
Direction for up
Returns whether all fields on the Vector are 0.
Returns the Euclidean length of the vector: √x² + y² + z²
Euclidean length of vector
Returns length of Vector excluding Z axis.
2D Length
Returns the squared length of the vector, x² + y² + z². Faster than
Returns the squared length of the vectors x and y value, x² + y². Faster than
Returns a list of that are valid and have a valid >= 0