Class CBasePlayerWeaponExtensions
- Namespace
- CounterStrikeSharp.API.Modules.Extensions
- Assembly
- CounterStrikeSharp.API.dll
public static class CBasePlayerWeaponExtensions
- Inheritance
-
objectCBasePlayerWeaponExtensions
Methods
GetEconOwner(CBasePlayerWeapon)
Gets the econ owner of a weapon entity
public static CCSPlayerController? GetEconOwner(this CBasePlayerWeapon weapon)
Parameters
weapon
CBasePlayerWeaponThe 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
CBasePlayerWeaponThe CBasePlayerWeapon instance.
Returns
- string
The designer name of the weapon as a string, or
null
if it cannot be retrieved.