Please or Register to create posts and topics.

FiveM + C#: Storing player data in MySQL/MariaDB database. Complete guide from scratch.

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.