#[derive(SampPlugin)]Expand description
Derive macro that generates an empty impl SampPlugin for T {} for structs
that do not need to customize any trait method. For structs with logic in
on_load/on_tick/etc, declare impl SampPlugin for T { ... }
manually instead of using the derive.
Generates impl SampPlugin for T {} with all methods using the default behavior
(empty). Use for structs that do not need to customize any lifecycle callback —
write the impl SampPlugin manually when some method needs custom logic.
ⓘ
use samp::prelude::*;
#[derive(SampPlugin)]
struct SimplePlugin { counter: u32 }
// With logic in on_load → do not use the derive
struct AdvancedPlugin;
impl SampPlugin for AdvancedPlugin {
fn on_load(&mut self) { println!("plugin loaded"); }
}