SwiftlyS2

CPlayer_WeaponServices

Interface CPlayer_WeaponServices

Namespace: SwiftlyS2.Shared.SchemaDefinitions

Assembly: SwiftlyS2.CS2.dll

public interface CPlayer_WeaponServices : CPlayerPawnComponent, ISchemaClass<CPlayerPawnComponent>, ISchemaClass<CPlayer_WeaponServices>, ISchemaField, ISchemaClass, INativeHandle

Implements

Properties

ActiveWeapon

ref CHandle<CBasePlayerWeapon> ActiveWeapon { get; }
Property Value

Ammo

ISchemaFixedArray<ushort> Ammo { get; }
Property Value

LastWeapon

ref CHandle<CBasePlayerWeapon> LastWeapon { get; }
Property Value

MyValidWeapons

IEnumerable<CBasePlayerWeapon> MyValidWeapons { get; }
Property Value

MyWeapons

ref CUtlVector<CHandle<CBasePlayerWeapon>> MyWeapons { get; }
Property Value

PreventWeaponPickup

ref bool PreventWeaponPickup { get; }
Property Value

Methods

ActiveWeaponUpdated()

void ActiveWeaponUpdated()

AmmoUpdated()

void AmmoUpdated()

DropWeapon(CBasePlayerWeapon)

Drop a weapon.

Thread unsafe, use async variant instead for non-main thread context.

[ThreadUnsafe]
void DropWeapon(CBasePlayerWeapon weapon)
Parameters

DropWeaponAsync(CBasePlayerWeapon)

Drop a weapon asynchronously.

Task DropWeaponAsync(CBasePlayerWeapon weapon)
Parameters
Returns

DropWeaponByClass<T>()

Drop all weapons with the specified class.

Thread unsafe, use async variant instead for non-main thread context.

[ThreadUnsafe]
void DropWeaponByClass<T>() where T : class, ISchemaClass<T>
Type Parameters
  • T — The weapon class.

DropWeaponByClassAsync<T>()

Drop all weapons with the specified class asynchronously.

Task DropWeaponByClassAsync<T>() where T : class, ISchemaClass<T>
Returns
Type Parameters
  • T — The weapon class.

DropWeaponByDesignerName(string)

Drop a weapon by designer name.

Thread unsafe, use async variant instead for non-main thread context.

[ThreadUnsafe]
void DropWeaponByDesignerName(string designerName)
Parameters
  • designerName string — The designer name of the weapon to drop.

DropWeaponByDesignerNameAsync(string)

Drop a weapon by designer name asynchronously.

Task DropWeaponByDesignerNameAsync(string designerName)
Parameters
  • designerName string — The designer name of the weapon to drop.
Returns

DropWeaponBySlot(gear_slot_t)

Drop a weapon by slot.

Thread unsafe, use async variant instead for non-main thread context.

[ThreadUnsafe]
void DropWeaponBySlot(gear_slot_t slot)
Parameters
  • slot gear_slot_t — The slot to drop the weapon from.

DropWeaponBySlotAsync(gear_slot_t)

Drop a weapon by slot asynchronously.

Task DropWeaponBySlotAsync(gear_slot_t slot)
Parameters
  • slot gear_slot_t — The slot to drop the weapon from.
Returns

LastWeaponUpdated()

void LastWeaponUpdated()

MyWeaponsUpdated()

void MyWeaponsUpdated()

RemoveWeapon(CBasePlayerWeapon)

Drop and remove a weapon.

Thread unsafe, use async variant instead for non-main thread context.

[ThreadUnsafe]
void RemoveWeapon(CBasePlayerWeapon weapon)
Parameters

RemoveWeaponAsync(CBasePlayerWeapon)

Remove a weapon asynchronously.

Task RemoveWeaponAsync(CBasePlayerWeapon weapon)
Parameters
Returns

RemoveWeaponByClass<T>()

Drop and remove all weapons with the specified class.

Thread unsafe, use async variant instead for non-main thread context.

[ThreadUnsafe]
void RemoveWeaponByClass<T>() where T : class, ISchemaClass<T>
Type Parameters
  • T — The weapon class.

RemoveWeaponByClassAsync<T>()

Remove all weapons with the specified class asynchronously.

Task RemoveWeaponByClassAsync<T>() where T : class, ISchemaClass<T>
Returns
Type Parameters
  • T — The weapon class.

RemoveWeaponByDesignerName(string)

Remove a weapon by designer name.

Thread unsafe, use async variant instead for non-main thread context.

[ThreadUnsafe]
void RemoveWeaponByDesignerName(string designerName)
Parameters
  • designerName string — The designer name of the weapon to remove.

RemoveWeaponByDesignerNameAsync(string)

Remove a weapon by designer name asynchronously.

Task RemoveWeaponByDesignerNameAsync(string designerName)
Parameters
  • designerName string — The designer name of the weapon to remove.
Returns

RemoveWeaponBySlot(gear_slot_t)

Remove a weapon by slot.

Thread unsafe, use async variant instead for non-main thread context.

[ThreadUnsafe]
void RemoveWeaponBySlot(gear_slot_t slot)
Parameters
  • slot gear_slot_t — The slot to remove the weapon from.

RemoveWeaponBySlotAsync(gear_slot_t)

Remove a weapon by slot asynchronously.

Task RemoveWeaponBySlotAsync(gear_slot_t slot)
Parameters
  • slot gear_slot_t — The slot to remove the weapon from.
Returns

SelectWeapon(CBasePlayerWeapon)

Make player select a weapon.

Thread unsafe, use async variant instead for non-main thread context.

void SelectWeapon(CBasePlayerWeapon weapon)
Parameters

SelectWeaponAsync(CBasePlayerWeapon)

Make player select a weapon asynchronously.

Task SelectWeaponAsync(CBasePlayerWeapon weapon)
Parameters
Returns

SelectWeaponByClass<T>()

Select a weapon by class.

Thread unsafe, use async variant instead for non-main thread context.

[ThreadUnsafe]
void SelectWeaponByClass<T>() where T : class, ISchemaClass<T>
Type Parameters
  • T — The weapon class.

SelectWeaponByClassAsync<T>()

Select a weapon by class asynchronously.

Task SelectWeaponByClassAsync<T>() where T : class, ISchemaClass<T>
Returns
Type Parameters
  • T — The weapon class.

SelectWeaponByDesignerName(string)

Select a weapon by designer name.

Thread unsafe, use async variant instead for non-main thread context.

[ThreadUnsafe]
void SelectWeaponByDesignerName(string designerName)
Parameters
  • designerName string — The designer name of the weapon to select.

SelectWeaponByDesignerNameAsync(string)

Select a weapon by designer name asynchronously.

Task SelectWeaponByDesignerNameAsync(string designerName)
Parameters
  • designerName string — The designer name of the weapon to select.
Returns

SelectWeaponBySlot(gear_slot_t)

Select a weapon by slot.

Thread unsafe, use async variant instead for non-main thread context.

[ThreadUnsafe]
void SelectWeaponBySlot(gear_slot_t slot)
Parameters
  • slot gear_slot_t — The slot to select the weapon from.

SelectWeaponBySlotAsync(gear_slot_t)

Select a weapon by slot asynchronously.

Task SelectWeaponBySlotAsync(gear_slot_t slot)
Parameters
  • slot gear_slot_t — The slot to select the weapon from.
Returns

On this page