bakkesmod

Crates.iobakkesmod
lib.rsbakkesmod
version0.2.1
sourcesrc
created_at2020-09-04 23:29:43.145291
updated_at2020-09-13 13:40:17.438679
descriptionRust SDK for writing BakkesMod plugins.
homepage
repositoryhttps://github.com/AratorRL/bakkesmod-rust
max_upload_size
id284890
size694,522
Bart van der Vecht (bvdvecht)

documentation

README

Rust SDK for BakkesMod plugins

Crates.io version docs.rs docs

Go to the documentation

Example

use bakkesmod::prelude::*;
use bakkesmod::wrappers::unreal::*;
use bakkesmod::{game, console};

#[plugin_init]
pub fn on_load() {
    console::register_notifier("get_ball_location", Box::new(move |_: Vec<String>| {
        let game = match bakkesmod::get_game_event_as_server() {
            Some(g) => g,
            None => {
                log_console!("game is null!");
                return;
            }
        };
        
        match game.get_ball() {
            Some(ball) => log_console!("{}", ball.get_location()),
            None => log_console!("ball is NULL")
        };
    }));
}

View more examples in the examples directory.

Commit count: 40

cargo fmt