rust-samp

hello — minimal plugin

Smallest viable rust-samp plugin. One native, no state, no lifecycle overrides.

What it demonstrates

Native

native Hello_Greet(const name[], greeting[] = "", size = sizeof(greeting));

Behavior:

Pawn usage

public OnGameModeInit()
{
    new buf[64];
    Hello_Greet("World", buf);
    print(buf); // "Hello, World! (5 letters)"
    return 1;
}

Build

cargo build --release --target i686-unknown-linux-gnu -p hello

Output: target/i686-unknown-linux-gnu/release/libhello.so.

Source

See src/lib.rs.