06.05.2014, 20:53
(
Last edited by ikkentim; 21/12/2019 at 04:22 PM.
)
SampSharp is a plugin and library which allows you to write SA-MP gamemodes in C#, VB or any other .NET language. The plugin works both on Linux and Windows. The library contains various classes for every type of resource available in SA-MP (players, vehicles, textdraws, etc). Aside from this wrapper around native functions, the library also contains a good structure to build your gamemode on.
SampSharp provides wrappers for existing plugins (currently only the streamer plugin) and a number of resources for writing wrappers for existing plugins. There are also a small number of example gamemodes available.
Feedback and suggestions are highly appreciated!
If you have any questions, please leave a message below.
The following snippet shows how easy it is to create a command which spawns a vehicle:
PHP Code:
class GameMode : BaseMode
{
protected override void OnPlayerConnected(BasePlayer player, EventArgs e)
{
base.OnPlayerConnected(player, e);
player.SendClientMessage($"Welcome {player.Name}, to a whole new world!");
}
[Command("spawn")]
public static void VehicleCommand(BasePlayer player, VehicleModelType model)
{
Console.WriteLine($"Spawning a {model} for {player.Name}");
var vehicle = BaseVehicle.Create(model, player.Position + new Vector3(0, 0, 0.5f), player.Rotation.Z);
player.PutInVehicle(vehicle);
player.SendClientMessage(Color.GreenYellow, $"You have spawned a {model}!");
}
}
https://github.com/ikkentim/SampSharp/releases
Current stable version:
Current unstable version:
Documentation
https://sampsharp.net
Source code
https://www.github.com/ikkentim/SampSharp