Table of Contents

Class CBasePlayerWeaponExtensions

Namespace
CounterStrikeSharp.API.Modules.Extensions
Assembly
CounterStrikeSharp.API.dll
public static class CBasePlayerWeaponExtensions
Inheritance
object
CBasePlayerWeaponExtensions

Methods

GetEconOwner(CBasePlayerWeapon)

Gets the econ owner of a weapon entity

public static CCSPlayerController? GetEconOwner(this CBasePlayerWeapon weapon)

Parameters

weapon CBasePlayerWeapon

The weapon entity.

Returns

CCSPlayerController

The CCSPlayerController instance for the player, or null if it doesn't exist.

GetWeaponName(CBasePlayerWeapon)

Gets the weapon's designer name (e.g., "weapon_ak47").

public static string? GetWeaponName(this CBasePlayerWeapon weapon)

Parameters

weapon CBasePlayerWeapon

The CBasePlayerWeapon instance.

Returns

string

The designer name of the weapon as a string, or null if it cannot be retrieved.