You are currently viewing FiveM + C#: Storing player data in MySQL/MariaDB database

FiveM + C#: Storing player data in MySQL/MariaDB database

The following video shows how to create both client and server scripts for FiveM that allows you to pass data from the client through the server and to store it in MySQL database. The tutorial consists of the following parts:

  1. Prepare basic client and server C# projects. In the following step I show you how to set dependency between mentioned projects, to force right build order and then to perform copy result artefacts to the game resources directory.
  2. Create simple working FiveM plug-ins. From this part of the tutorial you will learn how to create very basic pair of plug-ins – client and server side.
  3. Passing data from the game client to the FiveM server. In the following step you will register a client command, that displays chat message on the screen. After that you enrich it with ability to emit event to the server. At the end, you will display the received message to the sever console.
  4. In the final step of our journey, you will start from creating MySQL connection to the real database. After that you will use it to call insert statement that allows you to store data in the database.

That’s all what I’ve prepared for you in this tutorial, if I helped you, please consider sharing this post to help me gain a wider audience.
Thanks and I hope to see you in my next tutorial.