Quick Start
Welcome to SampSharp! This guide will help you create and run your first gamemode using SampSharp v1.x for open.mp.
Prerequisites
Before you begin, you'll need:
- .NET 10 SDK or later
- open.mp server with SampSharp component (see Setting Up open.mp Server)
- A basic understanding of C# and object-oriented programming
Choose Your IDE
Install Visual Studio with the .NET desktop development workload:
- Download and run the Visual Studio installer
- Select the
.NET desktop developmentworkload during installation - Complete the installation
Note
The .NET desktop development workload includes the .NET 10 SDK, so you don't need to install it separately.
Setting Up open.mp Server
SampSharp requires a 64-bit version of open.mp because the .NET runtime runs as x64.
Download the x64 build from the SampSharp open.mp x64 releases page and extract it anywhere on your system (e.g.,
C:\open.mpor~/open.mp).Download the SampSharp component from the SampSharp releases page and extract it into the
componentsdirectory of your open.mp server installation.Verify the install. Run
omp-server.exeonce from the open.mp directory and check the startup output for a line likeSuccessfully loaded component SampSharp (0.11.0.0). If SampSharp is missing from the loaded components list, the component files are not in the right place. You may see errors aboutruntimeconfig.jsonat the bottom of the log — those are expected at this stage since no gamemode has been built or wired up yet. Stop the server withCtrl+Conce verified.
Creating Your First Project
Install the SampSharp template:
dotnet new install SampSharp.Templates
Create a new project:
dotnet new sampsharp -n MyFirstGameMode
cd MyFirstGameMode
The template automatically creates:
- A configured
Startup.csclass with the ECS framework initialized - A sample
MyFirstSystem.cssystem with example events and commands - A
.csprojfile with the necessary SampSharp NuGet package references
Startup.cs implements IEcsStartup to configure the ECS framework, logging, and middleware.
MyFirstSystem.cs is an example system showing how to handle events, commands, and access services. For more details on systems, see the Systems page.
Running Your Gamemode
Configure Your IDE
- Open the project in Visual Studio.
- Press
F5or go to Debug > Start Debugging to launch the project with the debugger attached.
Launch Steps
The first launch is a one-time setup. The gamemode application starts on its own, detects it is not running inside an open.mp server, and helps you wire up a launch profile that starts the server with your gamemode loaded. Every launch after that reuses the profile.
- First Launch: Start the debugger with your launch configuration. The gamemode application starts in isolation, prints a setup banner, and prompts you to enter the path to your open.mp server directory.
- Enter Path: Provide the full path to your open.mp installation (e.g.,
C:\open.mpor/home/user/open.mp). - Profile Generated: A
Properties/launchSettings.jsonfile is written with anopen.mpprofile pointing atomp-server.exe, and the gamemode exits. - Second Launch: Start the debugger again. Your IDE uses the
open.mpprofile to launch the server, which loads the gamemode and attaches the debugger.
Tip
Properties/launchSettings.json is a standard .NET launch profile file. It hardcodes the path to your open.mp install, so add it to .gitignore rather than committing it — teammates can regenerate their own profile on first launch.
Next Steps
- Jump to a Specific Topic: Skip ahead to Command System, Vehicles, or another feature page.
- Check Out Examples: Visit the SampSharp samples repository for complete example gamemodes
- Join the Community: Have questions? Join us on Discord where you can get help and discuss development with other SampSharp developers