Skip to main content

Module plugin

Module plugin 

Source
Expand description

API the Rust plugin uses: trait SampPlugin (lifecycle) + global functions to enable features (enable_tick, logger, omp_query).

Structs§

TickConfig
Tells the SDK how often SampPlugin::on_tick should fire on each server.
TickContext
Per-call context delivered to SampPlugin::on_tick.

Enums§

TickSource
Origin of the current SampPlugin::on_tick invocation.

Traits§

SampPlugin
Plugin lifecycle. All methods are optional — the trait provides empty implementations so the plugin only overrides the relevant ones.

Functions§

disable_debug_hook
Removes the SDK debug hook previously installed by enable_debug_hook on amx, so SampPlugin::on_debug_break stops firing for it.
enable_debug_hook
Installs the SDK’s debug hook on amx, routing every executed line into SampPlugin::on_debug_break. Call from SampPlugin::on_amx_load for each AMX you want to debug (typically the gamemode).
enable_tick
Enables SampPlugin::on_tick with default settings: tick on both servers, 5 ms interval on Open Multiplayer.
enable_tick_with
Enables SampPlugin::on_tick with an explicit TickConfig.
logger
Returns a fern::Dispatch already chained into the server’s log system, disabling the SDK’s default routing.
omp_core
Returns the Open Multiplayer server’s ICore* pointer received in on_load.
omp_query
Looks up an Open Multiplayer component via its typed wrapper.
omp_query_component
Looks up an Open Multiplayer component by UID in the list received in on_init.