IGameService
Interface IGameService
Namespace: SwiftlyS2.Shared.Services
Assembly: SwiftlyS2.CS2.dll
public interface IGameServiceProperties
MatchData
Gets a read-only reference to the current match data.
ref readonly CCSMatch MatchData { get; }Methods
AddCTBonusPoints(int)
Adds bonus points to the Counter-Terrorist team.
void AddCTBonusPoints(int points)- points int — Bonus points to add.
AddCTScore(int)
Adds score to the Counter-Terrorist team.
void AddCTScore(int score)- score int — Score to add.
AddCTWins(int)
Adds wins to the Counter-Terrorist team.
void AddCTWins(int numWins)- numWins int — Number of wins to add.
AddTerroristBonusPoints(int)
Adds bonus points to the Terrorist team.
void AddTerroristBonusPoints(int points)- points int — Bonus points to add.
AddTerroristScore(int)
Adds score to the Terrorist team.
void AddTerroristScore(int score)- score int — Score to add.
AddTerroristWins(int)
Adds wins to the Terrorist team.
void AddTerroristWins(int numWins)- 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)- 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.
- CDecoyProjectile — The created decoy grenade projectile.
EmitDecoyAsync(Vector, QAngle, Vector, CBasePlayerPawn?)
Creates a decoy grenade projectile asynchronously.
Task<CDecoyProjectile> EmitDecoyAsync(Vector pos, QAngle angle, Vector velocity, CBasePlayerPawn? owner)- 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.
- Task<CDecoyProjectile> — The created decoy grenade projectile.
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)- 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.
- CFlashbangProjectile — The created flashbang grenade projectile.
EmitFlashbangAsync(Vector, QAngle, Vector, CBasePlayerPawn?)
Creates a flashbang grenade projectile asynchronously.
Task<CFlashbangProjectile> EmitFlashbangAsync(Vector pos, QAngle angle, Vector velocity, CBasePlayerPawn? owner)- 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.
- Task<CFlashbangProjectile> — The created flashbang grenade projectile.
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)- 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.
- CHEGrenadeProjectile — The created HE grenade projectile.
EmitHEGrenadeAsync(Vector, QAngle, Vector, CBasePlayerPawn?)
Creates a HE grenade projectile asynchronously.
Task<CHEGrenadeProjectile> EmitHEGrenadeAsync(Vector pos, QAngle angle, Vector velocity, CBasePlayerPawn? owner)- 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.
- Task<CHEGrenadeProjectile> — The created HE grenade projectile.
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)- 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.
- CMolotovProjectile — The created molotov grenade projectile.
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)- 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.
- Task<CMolotovProjectile> — The created molotov grenade projectile.
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)- 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.
- CSmokeGrenadeProjectile — The created smoke grenade projectile.
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)- 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.
- Task<CSmokeGrenadeProjectile> — The created smoke grenade projectile.
GetWinningTeam()
Gets the winning team ID.
int GetWinningTeam()- 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)- abortedMatch bool — Indicates whether the match was aborted
GoToOvertime(int)
Enters overtime mode.
void GoToOvertime(int numOvertimesToAdd = 1)- numOvertimesToAdd int — Number of overtime periods to add.
IncrementRound(int)
Increments the round count.
void IncrementRound(int numRounds = 1)- 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)- phase GamePhase — The game phase to set.
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)- reason RoundEndReason — The reason for ending the round
- delay float — The delay before ending the round