| title | SampSharp |
|---|---|
| _disableContribution | true |
| _disableAffix | true |
Build powerful open.mp game modes with modern C# and a proven Entity-Component-System architecture.
SampSharp is a framework that lets you write open.mp game modes in C# instead of Pawn. Powered by the .NET runtime, it brings modern programming practices, strong typing, and access to the entire NuGet ecosystem to SA-MP/open.mp development.
The new SampSharp v1.x (for open.mp) features an Entity-Component-System (ECS) architecture that makes your code more modular, testable, and maintainable compared to traditional callback-based approaches.
Build scalable systems with clear separation of concerns using the Entity-Component-System pattern
Write type-safe, expressive code with the latest C# language features and LINQ
.NET's performance and JIT compilation deliver efficient game mode execution
Use thousands of mature, reliable libraries for logging, JSON, async operations, and more
Run seamlessly on Windows and Linux servers
Get IntelliSense, debugging, and refactoring support from Visual Studio and VS Code. Deploy easily with Docker for consistent environments
class PlayerSystem : ISystem
{
[Event]
public void OnPlayerConnect(Player player)
{
player.SendClientMessage($"Welcome {player.Name}! You're the {player.Id}th player.");
Console.WriteLine($"{player.Name} connected to the server.");
}
[Event]
public void OnPlayerDisconnect(Player player)
{
Console.WriteLine($"{player.Name} disconnected from the server.");
}
}Ready to build? Check out the resources below:
- Documentation — Learn the framework concepts and architecture
- Sample Projects — Real-world examples to learn from
Have questions? Join us on Discord or visit the GitHub repository.