Capture The Flag is a game mode for SA-MP (San Andreas Multiplayer, a multiplayer mod for GTA San Andreas) created with 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.
- Gameplay
- Screenshots
- Technologies used
- Software Engineering
- Requirements to play
- Deployment without Docker
- Deployment with Docker
- Credentials
- How to become an admin?
- Supported RDBMS
- Architectural overview
- Credits
- Contribution
- License
The Beta team plays against the Alpha 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 necessary for the whole team to work together tactically to win.
The team which which got more points after 15 minutes wins. If both teams have the same points after the time is up, it's a draw.
Beware! Enemies will see flag carriers on their radar as well!
In this video, you can watch a gameplay demo: https://youtu.be/rsWCZaT4aBE or also see the play list.
- .NET CLI
- SA-MP Server
- CompileApp-FS
- Visual Studio 2022
- vscode
- MariaDB
- SQLite
- DB Browser for SQLite
- HeidiSQL
- GitHub Actions
- Git
- draw.io
- Docker
- .NET SDK 8.0
- SampSharp
- SampSharp-streamer
- samp-streamer-plugin
- YSF Server Functions
- SmartFormat
- MySqlConnector
- Microsoft.Data.Sqlite
- Microsoft.Extensions.DependencyInjection
- Microsoft.Extensions.Configuration.Binder
- Microsoft.Extensions.Configuration.EnvironmentVariables
- BCrypt.Net-Next
- DotEnv.Core
- YeSql.Net
- seztion-parser
- Serilog.Sinks.Console
- Serilog.Sinks.File
- Serilog.Extensions.Logging
Software engineering concepts have been applied in this project:
- Hexagonal architecture
- Entity–component–system (ECS)
- Object-oriented programming
- Interface-based programming
- Modular programming
- Dependency injection
- Operation Result Pattern
- Guard Clause
- Open-closed principle
- Explicit dependencies
- Separation of concerns
- You must have DirectX 9 installed on your local machine.
- You must download Grand Theft Auto: San Andreas on your local machine.
- You must download the SA-MP client or the open.mp launcher to connect to the servers.
- You must download Visual C++ Redistributable x86 to load plugins such as SampSharp and Streamer.
- You need to download the ctf-gamemode-windows.zip file that contains the files to run the game mode.
- Once downloaded, modify the
.env
file according to your needs. - Run the
samp-server.exe
.
- Clone the repository:
git clone https://github.com/MrDave1999/Capture-The-Flag.git
- Change directory:
cd Capture-The-Flag
- Copy the contents of
.env.example
to.env
:
cp .env.example .env
- Build the image and initiate services:
docker compose up --build -d
- Check the server logs to see if everything is working properly:
docker compose exec -it app cat server_log.txt
- Add the server IP in your SA-MP client:
localhost:7777
The following table shows the default credentials for authentication from the game mode.
PlayerName | Password |
---|---|
Admin_Player | 123456 |
Moderator_Player | 123456 |
VIP_Player | 123456 |
Basic_Player | 123456 |
Note that these credentials are only available if your database provider is in-memory. In your .env file you must indicate it as follows.
DatabaseProvider=InMemory
You must add your name and secret key from the .env
file:
ServerOwner__Name=MrDave # Your nickname in the game
ServerOwner__SecretKey=1234._%==?! # Specify the secret key to give me admin.
It is necessary to specify your secret key, which you will use when executing the command "/givemeadmin" in the game.
- Download sqlite3 CLI from here (select the file named sqlite-tools-win-x86).
- Create a file called
.env
in the root directory:
copy .env.example .env
- You must specify the name of the database provider from the .env file:
DatabaseProvider=SQLite
- You must specify the location of the database file:
SQLite__DataSource=C:\Users\mrdave\OneDrive\Desktop\gamemode.db
- Finally, you must import the database:
sqlite3 gamemode.db < ./scripts/sqlite/gamemode.sql
See the scripts for more information.
- Install MariaDb Server and set up your username and password.
- Create a file called
.env
in the root directory:
copy .env.example .env
- You must specify the name of the database provider from the .env file:
DatabaseProvider=MariaDB
- You must specify the connection string in the .env file:
MariaDB__Server=localhost
MariaDB__Port=3306
MariaDB__Database=gamemode
MariaDB__UserName=root
MariaDB__Password=123456789
- Finally, you must import the database:
mariadb -uroot -p123456789 gamemode < ./scripts/mariadb/gamemode.sql
See the scripts for more information.
- Application Core. Contains all the logic of the game called "Capture The Flag", including the rules and procedures that define how the game is played.
- Persistence layer. Contains all data access logic. The purpose of this layer is to prevent the filtering of data access logic in the application core.
- Host Application. Contains everything needed to run the game mode. It represents the entry point of the application.
This layer performs other tasks such as:
- Load application settings from
.env
file. - Select the database provider.
- Register services to DI Container.
- Add systems to the services collection.
- Enable desired ECS system features.
- Load application settings from
- MrDave1999 for creating the "Capture The Flag" game mode.
- ikkentim for creating the SampSharp framework.
- Nickk888SAMP for creating NTD (TextDraw Editor).
- samp-incognito for creating the streamer plugin.
- IS4Code for maintaining the YSF (Y_Less's Server Fixes) plugin.
- Area66 by DragonZafiro.
- d_dust5, SA_Hill, de_aztec and de_dust2_small by Elorreli.
- Compound and cs_rockwar by Amirab.
- DesertGlory, fy_iceworld2 and de_dust2_x3 by TheYoungCapone.
- EntryMap and TheConstruction by B4MB1[MC].
- fy_iceworld by Sleyer.
- fy_snow by UnuAlex.
- fy_snow2 by mihaibr.
- de_dust2 by JamesT85.
- Aim_Headshot by haubitze.
- Aim_Headshot2 by Niktia_Ruchkov.
- de_dust2_x1 by SpikY_.
- de_dust2_x2 by Amads.
- WarZone by Samarchai.
- cs_assault by Ghost-X.
- GateToHell and TheWild by Zniper.
- TheBunker by Dr.Pawno.
- cs_deagle5 by SENiOR.
- mp_jetdoor by saawan.
- Simpson by Risq.
- ZM_Italy - Unknown.
- zone_paintball by Famous.
- mp_island by Leo.
Any contribution is welcome! Remember that you can contribute not only in the code, but also in the documentation or even improve the tests.
Follow the steps below:
- Fork it
- Create your custom branch (git checkout -b my-new-change)
- Commit your changes (git commit -am 'Add some change')
- Push to the branch (git push origin my-new-change)
- Create new Pull Request
This project is licensed under the GNU Affero General Public License v3.0