rust-samp
Write SA-MP and open.mp plugins in safe Rust instead of C++. The same source compiles to a single binary that runs natively on both servers; the macros hide the FFI boilerplate and ABI-correct marshalling for Linux (Itanium) and Windows (MSVC).
This is the main crate — depend on it from your plugin's Cargo.toml.
Not affiliated. Independent community fork of samp-rs. Not affiliated with, endorsed by, or connected to SA-MP, the open.mp (Open Multiplayer) project, or the upstream
samp-rsrepository. "SA-MP" and "open.mp" belong to their respective owners and are named only to describe compatibility.
[]
= ["cdylib"]
[]
# Published as `rust-samp` to avoid name collision; aliased to `samp` so
# the import is short.
= { = "rust-samp", = "3" }
Minimal plugin:
use *;
use ;
;
initialize_plugin!;
Build for 32-bit (both servers are 32-bit):
Related crates in this workspace
rust-samp-sdk— low-level FFI bindings (AMX VM, open.mp component ABI). Depend on it directly only if you want raw access without the macros.rust-samp-codegen— the proc macros (#[native],initialize_plugin!,#[derive(SampPlugin)]). Re-exported byrust-samp; no need to depend on it directly.
Repository and full documentation
Source, examples and the long-form guide live at https://github.com/NullSablex/rust-samp.