Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

9.3.0 Release #265

Merged
merged 9 commits into from
Dec 25, 2024
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
</a>
</p>

**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).
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.
**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 base.

## Index
- [Gameplay](#gameplay)
Expand Down
9 changes: 9 additions & 0 deletions src/Application/Common/Resources/Messages.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/Application/Common/Resources/Messages.resx
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,9 @@
<data name="ResetPlayerStats" xml:space="preserve">
<value>{PlayerName} has reset their stats, such as score, kills and deaths</value>
</data>
<data name="ResetTeamStats" xml:space="preserve">
<value>{PlayerName} has reset the statistics of both teams (Alpha and Beta)</value>
</data>
<data name="RoleSuccessfullyChanged" xml:space="preserve">
<value>You have assigned the {RoleName} role to {PlayerName}</value>
</data>
Expand Down
9 changes: 9 additions & 0 deletions src/Application/Players/Accounts/Systems/PlayerStatsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ Beware! Enemies will see flag carriers on their radar as well!</value>
{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.
Expand Down Expand Up @@ -197,13 +198,15 @@ Beware! Enemies will see flag carriers on their radar as well!</value>
{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.</value>
{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.</value>
</data>
<data name="Public2" xml:space="preserve">
<value>{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}/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.
Expand Down
4 changes: 3 additions & 1 deletion src/Application/Players/HeadShotSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ public void OnPlayerTakeDamage(Player player, Player issuer, float amount, Weapo
{
PlayerInfo issuerInfo = issuer.GetInfo();
issuerInfo.AddHeadShots();
issuerInfo.StatsPerRound.AddCoins(5);
playerRepository.UpdateHeadShots(issuerInfo);
issuer.GameText("HeadShot +1", 3000, 3);
issuer.GameText("Headshot +1", 3000, 3);
issuer.SendClientMessage(Color.Yellow, "Headshot +1");
player.Health = 0;
}
}
Expand Down
20 changes: 20 additions & 0 deletions src/Application/Teams/Systems/TeamStatsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

public class TeamStatsSystem(
IDialogService dialogService,
IWorldService worldService,
TeamTextDrawRenderer teamTextDrawRenderer) : ISystem
{
[Event]
Expand All @@ -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)
{
Expand Down
Loading