From b05408a38fd670b5ac7f3385403da48c6c4284fa Mon Sep 17 00:00:00 2001
From: MrDave1999
Date: Sun, 22 Dec 2024 19:40:31 -0500
Subject: [PATCH 1/8] Update README.md
---
README.md | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 897d84e2..f7ebe108 100644
--- a/README.md
+++ b/README.md
@@ -26,7 +26,8 @@
-**Capture The Flag** is a game mode for [SA-MP](https://www.sa-mp.mp) (San Andreas Multiplayer, a multiplayer mod for GTA San Andreas) created with [SampSharp](https://github.com/ikkentim/SampSharp).
+**Capture The Flag** is a game mode for [open.mp](https://github.com/openmultiplayer) (Open Multiplayer, a multiplayer mod for GTA San Andreas) created with the [SampSharp](https://github.com/ikkentim/SampSharp) framework.
+
There are 2 flags on the map, one for each team. Players need to capture the enemy's flag and bring it back to their own one.
## Index
From 368a455e6c5abb01f78dcd4007e7c3a1cf5951f1 Mon Sep 17 00:00:00 2001
From: Dave Roman <43916038+MrDave1999@users.noreply.github.com>
Date: Wed, 25 Dec 2024 10:54:49 -0500
Subject: [PATCH 2/8] feat: Award 50 coins for headshots with the sniper (#260)
---
src/Application/Players/HeadShotSystem.cs | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/Application/Players/HeadShotSystem.cs b/src/Application/Players/HeadShotSystem.cs
index 5fb2b13a..47296aff 100644
--- a/src/Application/Players/HeadShotSystem.cs
+++ b/src/Application/Players/HeadShotSystem.cs
@@ -35,8 +35,10 @@ public void OnPlayerTakeDamage(Player player, Player issuer, float amount, Weapo
{
PlayerInfo issuerInfo = issuer.GetInfo();
issuerInfo.AddHeadShots();
+ issuerInfo.StatsPerRound.AddCoins(50);
playerRepository.UpdateHeadShots(issuerInfo);
- issuer.GameText("HeadShot +1", 3000, 3);
+ issuer.GameText("Headshot +1", 3000, 3);
+ issuer.SendClientMessage(Color.Yellow, "Headshot +1");
player.Health = 0;
}
}
From 1c9d00e67d9dddadfbdc26d236188fbb0c92bcc2 Mon Sep 17 00:00:00 2001
From: Dave Roman <43916038+MrDave1999@users.noreply.github.com>
Date: Wed, 25 Dec 2024 11:13:56 -0500
Subject: [PATCH 3/8] feat: Add keyboard shortcut for /mystats command (#261)
* /mystats is now mapped to the 'NUM 6' key
---
.../Players/Accounts/Systems/PlayerStatsSystem.cs | 9 +++++++++
.../GeneralCommands/Resources/DetailedCommandInfo.resx | 3 ++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/Application/Players/Accounts/Systems/PlayerStatsSystem.cs b/src/Application/Players/Accounts/Systems/PlayerStatsSystem.cs
index 8c6aba63..d9820db5 100644
--- a/src/Application/Players/Accounts/Systems/PlayerStatsSystem.cs
+++ b/src/Application/Players/Accounts/Systems/PlayerStatsSystem.cs
@@ -53,6 +53,15 @@ public void OnPlayerDeath(Player deadPlayer, Player killer, Weapon reason)
playerStatsRenderer.UpdateTextDraw(killer);
}
+ [Event]
+ public void OnPlayerKeyStateChange(Player player, Keys newKeys, Keys oldKeys)
+ {
+ if (KeyUtils.HasPressed(newKeys, oldKeys, Keys.AnalogRight))
+ {
+ ShowStats(player);
+ }
+ }
+
[PlayerCommand("re")]
public void ResetPlayerStats(Player player)
{
diff --git a/src/Application/Players/GeneralCommands/Resources/DetailedCommandInfo.resx b/src/Application/Players/GeneralCommands/Resources/DetailedCommandInfo.resx
index c1301d20..696483f5 100644
--- a/src/Application/Players/GeneralCommands/Resources/DetailedCommandInfo.resx
+++ b/src/Application/Players/GeneralCommands/Resources/DetailedCommandInfo.resx
@@ -197,7 +197,8 @@ Beware! Enemies will see flag carriers on their radar as well!
{Color2}Use the 'N' key to show the scoreboard with the players of both teams.
{Color2}Use the 'Y' key to show the weapons menu.
{Color2}Use the 'H' key to show your current weapons package.
-{Color2}Use the 'NUM 4' key to show a list of available combos and their benefits.
+{Color2}Use the 'NUM 4' key to show a list of available combos and their benefits.
+{Color2}Use the 'NUM 6' key to show your own statistics in the game.
{Color1}/topkills: {Color2}Display the list of top players based on their total number of kills.
From ba320eb03cf9571193931d58d007cbce0c2052c1 Mon Sep 17 00:00:00 2001
From: MrDave1999
Date: Wed, 25 Dec 2024 11:33:58 -0500
Subject: [PATCH 4/8] chore: Add /rstats to the moderator command list
---
.../Resources/DetailedCommandInfo.Designer.cs | 350 +++++++++---------
.../Resources/DetailedCommandInfo.resx | 1 +
2 files changed, 176 insertions(+), 175 deletions(-)
diff --git a/src/Application/Players/GeneralCommands/Resources/DetailedCommandInfo.Designer.cs b/src/Application/Players/GeneralCommands/Resources/DetailedCommandInfo.Designer.cs
index c727c9f6..b02cc7b8 100644
--- a/src/Application/Players/GeneralCommands/Resources/DetailedCommandInfo.Designer.cs
+++ b/src/Application/Players/GeneralCommands/Resources/DetailedCommandInfo.Designer.cs
@@ -1,175 +1,175 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.42000
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace CTF.Application.Players.GeneralCommands.Resources {
- using System;
-
-
- ///
- /// A strongly-typed resource class, for looking up localized strings, etc.
- ///
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class DetailedCommandInfo {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal DetailedCommandInfo() {
- }
-
- ///
- /// Returns the cached ResourceManager instance used by this class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager {
- get {
- if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CTF.Application.Players.GeneralCommands.Resources.DetailedCommandInfo", typeof(DetailedCommandInfo).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- ///
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture {
- get {
- return resourceCulture;
- }
- set {
- resourceCulture = value;
- }
- }
-
- ///
- /// Looks up a localized string similar to {Color1}/setrole: {Color2}Assigns a specific role to a player.
- ///{Color1}/settotalkills: {Color2}Sets the total kills to a specific player.
- ///{Color1}/setscore: {Color2}Sets the score of a player to a specified value.
- ///{Color1}/addscore: {Color2}Increases the player's score by a designated amount.
- ///{Color1}/addallscore: {Color2}Increases the score of all players by a specified amount.
- ///{Color1}/addcoins: {Color2}Increases the player's coins by a designated amount.
- ///{Color1}/addallcoins: {Color2}Grant a set nu [rest of string was truncated]";.
- ///
- internal static string Admin {
- get {
- return ResourceManager.GetString("Admin", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to {Color1}Capture The Flag is an open source project.
- ///{Color1}Check out its official repository:
- ///{Color2}https://github.com/MrDave1999/Capture-The-Flag
- ///{Color1}Creator and programmer: {Color2}MrDave (Dave Roman)
- ///{Color1}Mappers:{Color2}
- ///DragonZafiro, Elorreli, amirab, JamesT85,
- ///TheYoungCapone, B4MB1[MC], Sleyer, mihaibr,
- ///UnuAlex, SpikY_, Niktia_Ruchkov, Amads,
- ///Samarchai, haubitze, Ghost-X, Zniper, Dr.Pawno,
- ///SENiOR, saawan, Risq, Famous and Leo.
- ///{Color1}Acknowledgments to:{Color2}
- ///ikkentim for cr [rest of string was truncated]";.
- ///
- internal static string Credits {
- get {
- return ResourceManager.GetString("Credits", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to {Color1}This is a capture the flag game mode for SA-MP (San Andreas Multiplayer).
- ///{Color2}There are 2 flags on the map, one for each team.
- ///Players need to capture the enemy's flag and bring it back to their own one.
- ///{Color1}Gameplay:{Color2}
- ///The Alpha team plays against the Beta team.
- ///The aim is to carry the enemy's flag to the spawn of the own flag.
- ///The own flag needs to be at the spawn to score.
- ///So you have to conquer the opponent's flag and defend your own team's one at the same time.
- ///It's n [rest of string was truncated]";.
- ///
- internal static string Help {
- get {
- return ResourceManager.GetString("Help", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to {Color1}/maps: {Color2}Displays a list of available maps in the game.
- ///{Color1}/settimeleft: {Color2}Sets the remaining time for the current game session.
- ///{Color1}/startrt: {Color2}Starts the rotation timer for the current map.
- ///{Color1}/stoprt: {Color2}Stops the rotation timer for the current map.
- ///{Color1}/kick: {Color2}Kicks a player from the game.
- ///{Color1}/warn: {Color2}Issues a warning to a player for inappropriate behavior.
- ///{Color1}/setspawn: {Color2}Sets a new spawn point for players in the game.
/// [rest of string was truncated]";.
- ///
- internal static string Moderator {
- get {
- return ResourceManager.GetString("Moderator", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to {Color1}/help: {Color2}Display an introduction to the Capture The Flag game mode.
- ///{Color1}/credits: {Color2}Show credits for the game and contributors.
- ///{Color1}/ranks: {Color2}List the different player ranks and their requirements.
- ///{Color1}/mystats: {Color2}Display the statistics of the current player.
- ///{Color1}/stats: {Color2}Show the statistics of a specified player.
- ///{Color1}/tstats: {Color2}Display the statistics of the teams (Alpha and Beta).
- ///{Color1}/changepass: {Color2}Change your account passwor [rest of string was truncated]";.
- ///
- internal static string Public1 {
- get {
- return ResourceManager.GetString("Public1", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to {Color1}/topkills: {Color2}Display the list of top players based on their total number of kills.
- ///{Color1}/topspree: {Color2}Display the list of top players based on their maximum killing spree.
- ///{Color1}/team: {Color2}Switch to a different team.
- ///{Color1}/kill: {Color2}Eliminate your character for respawn purposes.
- ///{Color1}/re: {Color2}Reset the statistics of the current player.
- ///{Color1}/admins: {Color2}List the current server administrators.
- ///{Color1}/vips: {Color2}Display the list of VIP players.
- ///{Col [rest of string was truncated]";.
- ///
- internal static string Public2 {
- get {
- return ResourceManager.GetString("Public2", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to {Color1}/armour: {Color2}Grants you temporary armour, reducing damage taken from attacks.
- ///{Color1}/health: {Color2}Restores a portion of your health instantly.
- ///{Color1}/saw: {Color2}Deploys a powerful saw to cut through obstacles or defeat enemies.
- ///{Color1}/spray: {Color2}Releases a spray that can confuse and distract opponents.
- ///{Color1}/teargas: {Color2}Deploys tear gas, impairing visibility and causing disorientation to nearby enemies.
- ///{Color1}/givemecoins: {Color2}Awards you with in-game coins, enha [rest of string was truncated]";.
- ///
- internal static string VIP {
- get {
- return ResourceManager.GetString("VIP", resourceCulture);
- }
- }
- }
-}
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace CTF.Application.Players.GeneralCommands.Resources {
+ using System;
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class DetailedCommandInfo {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal DetailedCommandInfo() {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CTF.Application.Players.GeneralCommands.Resources.DetailedCommandInfo", typeof(DetailedCommandInfo).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to {Color1}/setrole: {Color2}Assigns a specific role to a player.
+ ///{Color1}/settotalkills: {Color2}Sets the total kills to a specific player.
+ ///{Color1}/setscore: {Color2}Sets the score of a player to a specified value.
+ ///{Color1}/addscore: {Color2}Increases the player's score by a designated amount.
+ ///{Color1}/addallscore: {Color2}Increases the score of all players by a specified amount.
+ ///{Color1}/addcoins: {Color2}Increases the player's coins by a designated amount.
+ ///{Color1}/addallcoins: {Color2}Grant a set nu [rest of string was truncated]";.
+ ///
+ internal static string Admin {
+ get {
+ return ResourceManager.GetString("Admin", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to {Color1}Capture The Flag is an open source project.
+ ///{Color1}Check out its official repository:
+ ///{Color2}https://github.com/MrDave1999/Capture-The-Flag
+ ///{Color1}Creator and programmer: {Color2}MrDave (Dave Roman)
+ ///{Color1}Mappers:{Color2}
+ ///DragonZafiro, Elorreli, amirab, JamesT85,
+ ///TheYoungCapone, B4MB1[MC], Sleyer, mihaibr,
+ ///UnuAlex, SpikY_, Niktia_Ruchkov, Amads,
+ ///Samarchai, haubitze, Ghost-X, Zniper, Dr.Pawno,
+ ///SENiOR, saawan, Risq, Famous and Leo.
+ ///{Color1}Acknowledgments to:{Color2}
+ ///ikkentim for cr [rest of string was truncated]";.
+ ///
+ internal static string Credits {
+ get {
+ return ResourceManager.GetString("Credits", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to {Color1}This is a capture the flag game mode for SA-MP (San Andreas Multiplayer).
+ ///{Color2}There are 2 flags on the map, one for each team.
+ ///Players need to capture the enemy's flag and bring it back to their own one.
+ ///{Color1}Gameplay:{Color2}
+ ///The Alpha team plays against the Beta team.
+ ///The aim is to carry the enemy's flag to the spawn of the own flag.
+ ///The own flag needs to be at the spawn to score.
+ ///So you have to conquer the opponent's flag and defend your own team's one at the same time.
+ ///It's n [rest of string was truncated]";.
+ ///
+ internal static string Help {
+ get {
+ return ResourceManager.GetString("Help", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to {Color1}/maps: {Color2}Displays a list of available maps in the game.
+ ///{Color1}/settimeleft: {Color2}Sets the remaining time for the current game session.
+ ///{Color1}/startrt: {Color2}Starts the rotation timer for the current map.
+ ///{Color1}/stoprt: {Color2}Stops the rotation timer for the current map.
+ ///{Color1}/rstats: {Color2}Reset the statistics of both teams (Alpha and Beta).
+ ///{Color1}/kick: {Color2}Kicks a player from the game.
+ ///{Color1}/warn: {Color2}Issues a warning to a player for inappropriate behavio [rest of string was truncated]";.
+ ///
+ internal static string Moderator {
+ get {
+ return ResourceManager.GetString("Moderator", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to {Color1}/help: {Color2}Display an introduction to the Capture The Flag game mode.
+ ///{Color1}/credits: {Color2}Show credits for the game and contributors.
+ ///{Color1}/ranks: {Color2}List the different player ranks and their requirements.
+ ///{Color1}/mystats: {Color2}Display the statistics of the current player.
+ ///{Color1}/stats: {Color2}Show the statistics of a specified player.
+ ///{Color1}/tstats: {Color2}Display the statistics of the teams (Alpha and Beta).
+ ///{Color1}/changepass: {Color2}Change your account passwor [rest of string was truncated]";.
+ ///
+ internal static string Public1 {
+ get {
+ return ResourceManager.GetString("Public1", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to {Color1}/topkills: {Color2}Display the list of top players based on their total number of kills.
+ ///{Color1}/topspree: {Color2}Display the list of top players based on their maximum killing spree.
+ ///{Color1}/team: {Color2}Switch to a different team.
+ ///{Color1}/kill: {Color2}Eliminate your character for respawn purposes.
+ ///{Color1}/re: {Color2}Reset the statistics of the current player.
+ ///{Color1}/admins: {Color2}List the current server administrators.
+ ///{Color1}/vips: {Color2}Display the list of VIP players.
+ ///{Col [rest of string was truncated]";.
+ ///
+ internal static string Public2 {
+ get {
+ return ResourceManager.GetString("Public2", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to {Color1}/armour: {Color2}Grants you temporary armour, reducing damage taken from attacks.
+ ///{Color1}/health: {Color2}Restores a portion of your health instantly.
+ ///{Color1}/saw: {Color2}Deploys a powerful saw to cut through obstacles or defeat enemies.
+ ///{Color1}/spray: {Color2}Releases a spray that can confuse and distract opponents.
+ ///{Color1}/teargas: {Color2}Deploys tear gas, impairing visibility and causing disorientation to nearby enemies.
+ ///{Color1}/givemecoins: {Color2}Awards you with in-game coins, enha [rest of string was truncated]";.
+ ///
+ internal static string VIP {
+ get {
+ return ResourceManager.GetString("VIP", resourceCulture);
+ }
+ }
+ }
+}
diff --git a/src/Application/Players/GeneralCommands/Resources/DetailedCommandInfo.resx b/src/Application/Players/GeneralCommands/Resources/DetailedCommandInfo.resx
index 696483f5..08ecefa8 100644
--- a/src/Application/Players/GeneralCommands/Resources/DetailedCommandInfo.resx
+++ b/src/Application/Players/GeneralCommands/Resources/DetailedCommandInfo.resx
@@ -166,6 +166,7 @@ Beware! Enemies will see flag carriers on their radar as well!
{Color1}/settimeleft: {Color2}Sets the remaining time for the current game session.
{Color1}/startrt: {Color2}Starts the rotation timer for the current map.
{Color1}/stoprt: {Color2}Stops the rotation timer for the current map.
+{Color1}/rstats: {Color2}Reset the statistics of both teams (Alpha and Beta).
{Color1}/kick: {Color2}Kicks a player from the game.
{Color1}/warn: {Color2}Issues a warning to a player for inappropriate behavior.
{Color1}/setspawn: {Color2}Sets a new spawn point for players in the game.
From b195e455a8d3c5b05886efa57e80430cd350aa68 Mon Sep 17 00:00:00 2001
From: MrDave1999
Date: Wed, 25 Dec 2024 11:35:32 -0500
Subject: [PATCH 5/8] feat: Allow moderators to reset stats for both teams
(Alpha and Beta)
---
.../Common/Resources/Messages.Designer.cs | 9 +++++++++
.../Common/Resources/Messages.resx | 3 +++
.../Teams/Systems/TeamStatsSystem.cs | 20 +++++++++++++++++++
3 files changed, 32 insertions(+)
diff --git a/src/Application/Common/Resources/Messages.Designer.cs b/src/Application/Common/Resources/Messages.Designer.cs
index a9b2ce93..cc394f24 100644
--- a/src/Application/Common/Resources/Messages.Designer.cs
+++ b/src/Application/Common/Resources/Messages.Designer.cs
@@ -888,6 +888,15 @@ internal static string ResetPlayerStats {
}
}
+ ///
+ /// Looks up a localized string similar to {PlayerName} has reset the statistics of both teams (Alpha and Beta).
+ ///
+ internal static string ResetTeamStats {
+ get {
+ return ResourceManager.GetString("ResetTeamStats", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to You have assigned the {RoleName} role to {PlayerName}.
///
diff --git a/src/Application/Common/Resources/Messages.resx b/src/Application/Common/Resources/Messages.resx
index b318a23c..6d677c93 100644
--- a/src/Application/Common/Resources/Messages.resx
+++ b/src/Application/Common/Resources/Messages.resx
@@ -393,6 +393,9 @@
{PlayerName} has reset their stats, such as score, kills and deaths
+
+ {PlayerName} has reset the statistics of both teams (Alpha and Beta)
+
You have assigned the {RoleName} role to {PlayerName}
diff --git a/src/Application/Teams/Systems/TeamStatsSystem.cs b/src/Application/Teams/Systems/TeamStatsSystem.cs
index a28527df..fa5c10e4 100644
--- a/src/Application/Teams/Systems/TeamStatsSystem.cs
+++ b/src/Application/Teams/Systems/TeamStatsSystem.cs
@@ -2,6 +2,7 @@
public class TeamStatsSystem(
IDialogService dialogService,
+ IWorldService worldService,
TeamTextDrawRenderer teamTextDrawRenderer) : ISystem
{
[Event]
@@ -23,6 +24,25 @@ public void OnPlayerDeath(Player deadPlayer, Player killer, Weapon reason)
killerInfo.Team.StatsPerRound.AddKills();
}
+ [PlayerCommand("rstats")]
+ public void ResetStats(Player player)
+ {
+ if (player.HasLowerRoleThan(RoleId.Moderator))
+ return;
+
+ Team alphaTeam = Team.Alpha;
+ Team betaTeam = Team.Beta;
+ alphaTeam.StatsPerRound.Reset();
+ betaTeam.StatsPerRound.Reset();
+ teamTextDrawRenderer.UpdateTeamScore(alphaTeam);
+ teamTextDrawRenderer.UpdateTeamScore(betaTeam);
+ var message = Smart.Format(Messages.ResetTeamStats, new
+ {
+ PlayerName = player.Name
+ });
+ worldService.SendClientMessage(Color.Yellow, message);
+ }
+
[PlayerCommand("tstats")]
public void ShowStats(Player player)
{
From b63523719998e0d7003146078e1b922fd85957d9 Mon Sep 17 00:00:00 2001
From: Dave Roman <43916038+MrDave1999@users.noreply.github.com>
Date: Wed, 25 Dec 2024 11:50:39 -0500
Subject: [PATCH 6/8] feat: Allow players to get a parachute through a command
(#263)
---
.../Players/GeneralCommands/Public/PublicCommands.cs | 6 ++++++
.../Resources/DetailedCommandInfo.Designer.cs | 4 ++--
.../GeneralCommands/Resources/DetailedCommandInfo.resx | 1 +
3 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/Application/Players/GeneralCommands/Public/PublicCommands.cs b/src/Application/Players/GeneralCommands/Public/PublicCommands.cs
index e94a0bdd..626196e3 100644
--- a/src/Application/Players/GeneralCommands/Public/PublicCommands.cs
+++ b/src/Application/Players/GeneralCommands/Public/PublicCommands.cs
@@ -28,6 +28,12 @@ public void ShowCredits(Player player)
dialogService.ShowAsync(player, dialog);
}
+ [PlayerCommand("p")]
+ public void GiveParachute(Player player)
+ {
+ player.GiveWeapon(Weapon.Parachute, 1);
+ }
+
[PlayerCommand("kill")]
public void Kill(Player player)
{
diff --git a/src/Application/Players/GeneralCommands/Resources/DetailedCommandInfo.Designer.cs b/src/Application/Players/GeneralCommands/Resources/DetailedCommandInfo.Designer.cs
index b02cc7b8..11f8a686 100644
--- a/src/Application/Players/GeneralCommands/Resources/DetailedCommandInfo.Designer.cs
+++ b/src/Application/Players/GeneralCommands/Resources/DetailedCommandInfo.Designer.cs
@@ -147,10 +147,10 @@ internal static string Public1 {
///{Color1}/topspree: {Color2}Display the list of top players based on their maximum killing spree.
///{Color1}/team: {Color2}Switch to a different team.
///{Color1}/kill: {Color2}Eliminate your character for respawn purposes.
+ ///{Color1}/p: {Color2}Allows the player to get a parachute.
///{Color1}/re: {Color2}Reset the statistics of the current player.
///{Color1}/admins: {Color2}List the current server administrators.
- ///{Color1}/vips: {Color2}Display the list of VIP players.
- ///{Col [rest of string was truncated]";.
+ ///{C [rest of string was truncated]";.
///
internal static string Public2 {
get {
diff --git a/src/Application/Players/GeneralCommands/Resources/DetailedCommandInfo.resx b/src/Application/Players/GeneralCommands/Resources/DetailedCommandInfo.resx
index 08ecefa8..4e31c2ba 100644
--- a/src/Application/Players/GeneralCommands/Resources/DetailedCommandInfo.resx
+++ b/src/Application/Players/GeneralCommands/Resources/DetailedCommandInfo.resx
@@ -206,6 +206,7 @@ Beware! Enemies will see flag carriers on their radar as well!
{Color1}/topspree: {Color2}Display the list of top players based on their maximum killing spree.
{Color1}/team: {Color2}Switch to a different team.
{Color1}/kill: {Color2}Eliminate your character for respawn purposes.
+{Color1}/p: {Color2}Allows the player to get a parachute.
{Color1}/re: {Color2}Reset the statistics of the current player.
{Color1}/admins: {Color2}List the current server administrators.
{Color1}/vips: {Color2}Display the list of VIP players.
From fdd045afae8fc31a2a09ba06fec3bcee5ddd9cb9 Mon Sep 17 00:00:00 2001
From: MrDave1999
Date: Wed, 25 Dec 2024 12:01:04 -0500
Subject: [PATCH 7/8] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index f7ebe108..14004ef6 100644
--- a/README.md
+++ b/README.md
@@ -28,7 +28,7 @@
**Capture The Flag** is a game mode for [open.mp](https://github.com/openmultiplayer) (Open Multiplayer, a multiplayer mod for GTA San Andreas) created with the [SampSharp](https://github.com/ikkentim/SampSharp) framework.
-There are 2 flags on the map, one for each team. Players need to capture the enemy's flag and bring it back to their own one.
+There are 2 flags on the map, one for each team. Players need to capture the enemy's flag and bring it back to their own base.
## Index
- [Gameplay](#gameplay)
From 21afe1293fc1ac0827e81ee19c122320abee48ff Mon Sep 17 00:00:00 2001
From: Dave Roman <43916038+MrDave1999@users.noreply.github.com>
Date: Wed, 25 Dec 2024 16:43:07 -0500
Subject: [PATCH 8/8] feat: Award only 5 coins for headshots with the sniper
(#264)
The reward for headshots with the sniper rifle has been reduced to 5 coins in order to better balance the in-game economy. This change helps distribute coins more fairly, preventing excessive accumulation from headshots and encouraging players to focus more on capturing the flag.
---
src/Application/Players/HeadShotSystem.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Application/Players/HeadShotSystem.cs b/src/Application/Players/HeadShotSystem.cs
index 47296aff..ca3915ef 100644
--- a/src/Application/Players/HeadShotSystem.cs
+++ b/src/Application/Players/HeadShotSystem.cs
@@ -35,7 +35,7 @@ public void OnPlayerTakeDamage(Player player, Player issuer, float amount, Weapo
{
PlayerInfo issuerInfo = issuer.GetInfo();
issuerInfo.AddHeadShots();
- issuerInfo.StatsPerRound.AddCoins(50);
+ issuerInfo.StatsPerRound.AddCoins(5);
playerRepository.UpdateHeadShots(issuerInfo);
issuer.GameText("Headshot +1", 3000, 3);
issuer.SendClientMessage(Color.Yellow, "Headshot +1");