PickupsApi 1.7.0

dotnet add package PickupsApi --version 1.7.0
                    
NuGet\Install-Package PickupsApi -Version 1.7.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PickupsApi" Version="1.7.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PickupsApi" Version="1.7.0" />
                    
Directory.Packages.props
<PackageReference Include="PickupsApi" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add PickupsApi --version 1.7.0
                    
#r "nuget: PickupsApi, 1.7.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package PickupsApi@1.7.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=PickupsApi&version=1.7.0
                    
Install as a Cake Addin
#tool nuget:?package=PickupsApi&version=1.7.0
                    
Install as a Cake Tool

PickupsApi

Shared API for CS2-Pickups, a CounterStrikeSharp plugin suite for running CS2 pickup (PUG) games. Reference this package to read match state and hook match lifecycle events from your own plugin.

The API is implemented by PickupsCore, so the server needs CS2-Pickups installed at runtime.

Install

<PackageReference Include="PickupsApi" Version="1.4.0" ExcludeAssets="runtime" />

ExcludeAssets="runtime" matters: the DLL is loaded by the server from addons/counterstrikesharp/shared/PickupsApi, so shipping a second copy next to your plugin breaks the shared-assembly load.

Usage

Grab the capability once all plugins are loaded, then read state or subscribe to events:

using CounterStrikeSharp.API;
using CounterStrikeSharp.API.Core;
using PickupsApi;
using PickupsApi.Types;

public class MyPlugin : BasePlugin
{
    private IPickupsApi? _pickups;

    public override void OnAllPluginsLoaded(bool hotReload)
    {
        _pickups = IPickupsApi.PluginCapability.Get();
        if (_pickups is null)
            return; // CS2-Pickups is not installed

        _pickups.OnMatchStart += () => Server.PrintToChatAll("Match started!");
        _pickups.OnMatchEnd += winner => Server.PrintToChatAll($"Team {winner} won!");
    }

    public bool IsLive() =>
        _pickups?.IsMatchRunning() == true && _pickups.GetRoundType() == RoundType.Normal;
}

Surface

Member Purpose
IsMatchRunning() Whether a match is currently running
GetRoundType() Current RoundType: Warmup, Normal, LeaderKnife, SelectingPlayers, Knife, SelectingTeam
GetLeader(Team) That team's leader, or null if unset or disconnected
GetTeamForSide(CsTeam) The team identity on a side, or Team.None
GetSideForTeam(Team) The side a team is currently on, or CsTeam.None
GetTeamPlayers(Team) Snapshot of the connected human players on a team
CurrentMatchId UUIDv7 for the current or most recent match. Set at OnMatchPreStartPost(true), not cleared when the match ends, so every terminal hook can name it. Not a liveness flag — use GetRoundType() == RoundType.Normal for that
LastMatchEndReason Normal, Surrender, Stopped, or None while a match runs
SurrenderedByTeam The team that surrendered, when that is how the match ended
OnMatchPreStart Func<bool> — return false to veto the match start. Every subscriber is asked until one vetoes, so it is for the veto only, never for notifications
OnMatchPreStartPost The verdict of OnMatchPreStart: true when the match is starting, false when it was vetoed. This is where a start notification belongs
OnMatchStart / OnHalftimeStart / OnMatchStop Match lifecycle
OnMatchEnd / OnMatchEndPost Winning Team. OnMatchEnd is the last hook with players still connected — snapshot rosters there. OnMatchEndPost runs after every player has been kicked
OnMoveLeaders / OnMovePlayer Fired as leader selection assigns teams
OnGameStats Game stats were requested to be updated
OnPreparingRoundStart A preparing round started (LeaderKnife, SelectingPlayers, Knife, SelectingTeam), passed as the argument

Teams are Team.A / Team.B (Team.None when unassigned), not CS2's T/CT sides — sides swap at halftime, team identity does not. Game events report sides, so GetTeamForSide is how a side becomes something worth storing. A round record should keep both: the side is what the game said, the team is what a reader wants to see.

License

Apache-2.0

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.7.0 105 9/5/2026
1.6.1 92 8/31/2026
1.6.0 104 8/31/2026
1.5.0 94 8/29/2026
1.4.0 106 8/25/2026
1.3.0 120 8/21/2026
1.2.0 105 8/13/2026
1.1.0 101 8/13/2026
1.0.1 102 8/11/2026
1.0.0 102 8/11/2026