Setting up C# and creating a basic resource
FiveM runs C# resources, not just Lua. Here's the deal: C# catches your mistakes before the server ever starts, your editor autocompletes everything, and you get the whole .NET toolbox for hard stuff like external API calls. This lesson builds a C# resource from nothing - the project files, the BaseScript class (the base class FiveM looks for to run your code), and how you call FiveM's built-in functions from C#.
Build it
Create the C# project
In your resources folder:
mkdir resources/qu_csharp_demo
cd resources/qu_csharp_demo
dotnet new classlib --framework netstandard2.1
dotnet add package CitizenFX.Core --version 1.0.*
Rename Class1.cs to ServerMain.cs, then add a second file ClientMain.cs for the client-side code. You will compile these into a server assembly and a client assembly.