SwiftlyS2

IGameService

Interface IGameService

Namespace: SwiftlyS2.Shared.Services

Assembly: SwiftlyS2.CS2.dll

public interface IGameService

Properties

MatchData

Gets a read-only reference to the current match data.

ref readonly CCSMatch MatchData { get; }
Property Value

Methods

AddCTBonusPoints(int)

Adds bonus points to the Counter-Terrorist team.

void AddCTBonusPoints(int points)
Parameters
  • points int — Bonus points to add.

AddCTScore(int)

Adds score to the Counter-Terrorist team.

void AddCTScore(int score)
Parameters
  • score int — Score to add.

AddCTWins(int)

Adds wins to the Counter-Terrorist team.

void AddCTWins(int numWins)
Parameters
  • numWins int — Number of wins to add.

AddTerroristBonusPoints(int)

Adds bonus points to the Terrorist team.

void AddTerroristBonusPoints(int points)
Parameters
  • points int — Bonus points to add.

AddTerroristScore(int)

Adds score to the Terrorist team.

void AddTerroristScore(int score)
Parameters
  • score int — Score to add.

AddTerroristWins(int)

Adds wins to the Terrorist team.

void AddTerroristWins(int numWins)
Parameters
  • numWins int — Number of wins to add.

EmitDecoy(Vector, QAngle, Vector, CBasePlayerPawn?)

Creates a decoy grenade projectile.

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

[ThreadUnsafe]
CDecoyProjectile EmitDecoy(Vector pos, QAngle angle, Vector velocity, CBasePlayerPawn? owner)
Parameters
  • pos Vector — The position where the decoy grenade projectile will be created.
  • angle QAngle — The angle at which the decoy grenade projectile will be created.
  • velocity Vector — The velocity of the decoy grenade projectile.
  • owner CBasePlayerPawn? — The owner of the decoy grenade projectile.
Returns

EmitDecoyAsync(Vector, QAngle, Vector, CBasePlayerPawn?)

Creates a decoy grenade projectile asynchronously.

Task<CDecoyProjectile> EmitDecoyAsync(Vector pos, QAngle angle, Vector velocity, CBasePlayerPawn? owner)
Parameters
  • pos Vector — The position where the decoy grenade projectile will be created.
  • angle QAngle — The angle at which the decoy grenade projectile will be created.
  • velocity Vector — The velocity of the decoy grenade projectile.
  • owner CBasePlayerPawn? — The owner of the decoy grenade projectile.
Returns

EmitFlashbang(Vector, QAngle, Vector, CBasePlayerPawn?)

Creates a flashbang grenade projectile.

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

[ThreadUnsafe]
CFlashbangProjectile EmitFlashbang(Vector pos, QAngle angle, Vector velocity, CBasePlayerPawn? owner)
Parameters
  • pos Vector — The position where the flashbang grenade projectile will be created.
  • angle QAngle — The angle at which the flashbang grenade projectile will be created.
  • velocity Vector — The velocity of the flashbang grenade projectile.
  • owner CBasePlayerPawn? — The owner of the flashbang grenade projectile.
Returns

EmitFlashbangAsync(Vector, QAngle, Vector, CBasePlayerPawn?)

Creates a flashbang grenade projectile asynchronously.

Task<CFlashbangProjectile> EmitFlashbangAsync(Vector pos, QAngle angle, Vector velocity, CBasePlayerPawn? owner)
Parameters
  • pos Vector — The position where the flashbang grenade projectile will be created.
  • angle QAngle — The angle at which the flashbang grenade projectile will be created.
  • velocity Vector — The velocity of the flashbang grenade projectile.
  • owner CBasePlayerPawn? — The owner of the flashbang grenade projectile.
Returns

EmitHEGrenade(Vector, QAngle, Vector, CBasePlayerPawn?)

Creates a HE grenade projectile.

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

[ThreadUnsafe]
CHEGrenadeProjectile EmitHEGrenade(Vector pos, QAngle angle, Vector velocity, CBasePlayerPawn? owner)
Parameters
  • pos Vector — The position where the HE grenade projectile will be created.
  • angle QAngle — The angle at which the HE grenade projectile will be created.
  • velocity Vector — The velocity of the HE grenade projectile.
  • owner CBasePlayerPawn? — The owner of the HE grenade projectile.
Returns

EmitHEGrenadeAsync(Vector, QAngle, Vector, CBasePlayerPawn?)

Creates a HE grenade projectile asynchronously.

Task<CHEGrenadeProjectile> EmitHEGrenadeAsync(Vector pos, QAngle angle, Vector velocity, CBasePlayerPawn? owner)
Parameters
  • pos Vector — The position where the HE grenade projectile will be created.
  • angle QAngle — The angle at which the HE grenade projectile will be created.
  • velocity Vector — The velocity of the HE grenade projectile.
  • owner CBasePlayerPawn? — The owner of the HE grenade projectile.
Returns

EmitMolotov(Vector, QAngle, Vector, Team, CBasePlayerPawn?)

Creates a molotov grenade projectile.

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

[ThreadUnsafe]
CMolotovProjectile EmitMolotov(Vector pos, QAngle angle, Vector velocity, Team team, CBasePlayerPawn? owner)
Parameters
  • pos Vector — The position where the molotov grenade projectile will be created.
  • angle QAngle — The angle at which the molotov grenade projectile will be created.
  • velocity Vector — The velocity of the molotov grenade projectile.
  • team Team — The team of the molotov grenade projectile.
  • owner CBasePlayerPawn? — The owner of the molotov grenade projectile.
Returns

EmitMolotovAsync(Vector, QAngle, Vector, Team, CBasePlayerPawn?)

Creates a molotov grenade projectile asynchronously.

Task<CMolotovProjectile> EmitMolotovAsync(Vector pos, QAngle angle, Vector velocity, Team team, CBasePlayerPawn? owner)
Parameters
  • pos Vector — The position where the molotov grenade projectile will be created.
  • angle QAngle — The angle at which the molotov grenade projectile will be created.
  • velocity Vector — The velocity of the molotov grenade projectile.
  • team Team — The team of the molotov grenade projectile.
  • owner CBasePlayerPawn? — The owner of the molotov grenade projectile.
Returns

EmitSmokeGrenade(Vector, QAngle, Vector, Team, CBasePlayerPawn?)

Creates a smoke grenade projectile.

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

[ThreadUnsafe]
CSmokeGrenadeProjectile EmitSmokeGrenade(Vector pos, QAngle angle, Vector velocity, Team team, CBasePlayerPawn? owner)
Parameters
  • pos Vector — The position where the smoke grenade projectile will be created.
  • angle QAngle — The angle at which the smoke grenade projectile will be created.
  • velocity Vector — The velocity of the smoke grenade projectile.
  • team Team — The team associated with the smoke grenade projectile.
  • owner CBasePlayerPawn? — The owner of the smoke grenade projectile.
Returns

EmitSmokeGrenadeAsync(Vector, QAngle, Vector, Team, CBasePlayerPawn?)

Creates a smoke grenade projectile asynchronously.

Task<CSmokeGrenadeProjectile> EmitSmokeGrenadeAsync(Vector pos, QAngle angle, Vector velocity, Team team, CBasePlayerPawn? owner)
Parameters
  • pos Vector — The position where the smoke grenade projectile will be created.
  • angle QAngle — The angle at which the smoke grenade projectile will be created.
  • velocity Vector — The velocity of the smoke grenade projectile.
  • team Team — The team associated with the smoke grenade projectile.
  • owner CBasePlayerPawn? — The owner of the smoke grenade projectile.
Returns

GetWinningTeam()

Gets the winning team ID.

int GetWinningTeam()
Returns
  • int — Team ID of the winner, or 0 if tie.

GoToIntermission(bool)

Go to the intermission phase of the game.

void GoToIntermission(bool abortedMatch = false)
Parameters
  • abortedMatch bool — Indicates whether the match was aborted

GoToOvertime(int)

Enters overtime mode.

void GoToOvertime(int numOvertimesToAdd = 1)
Parameters
  • numOvertimesToAdd int — Number of overtime periods to add.

IncrementRound(int)

Increments the round count.

void IncrementRound(int numRounds = 1)
Parameters
  • numRounds int — Number of rounds to increment.

Reset()

Resets all match data to initial state.

void Reset()

SetPhase(GamePhase)

Sets the current game phase.

void SetPhase(GamePhase phase)
Parameters

SwapTeamScores()

Swaps the team scores between Terrorist and Counter-Terrorist.

void SwapTeamScores()

TerminateRound(RoundEndReason, float)

Ends the current round with the specified reason after an optional delay

void TerminateRound(RoundEndReason reason, float delay)
Parameters
  • reason RoundEndReason — The reason for ending the round
  • delay float — The delay before ending the round

On this page