0.1.0
Pre-release
Pre-release
First Release of OMPRS
Writing my first gamemode in Rust
-
Download the omprs component from here
-
Place the
Rust.dll
orRust.so
component incomponents
folder -
Create a new rust project
cargo new mygm --lib
-
Add
omp
to dependecies
cargo add omp
-
Add this to your
Cargo.toml
[lib] crate-type = ["cdylib"]
-
Write a basic code like this
use omp::{events::Events, main, register, types::colour::Colour}; struct MyGM; impl Events for MyGM { fn on_player_connect(&mut self, player: omp::players::Player) { player.send_client_message(Colour::from_rgba(0xFFFFFFFF), "Welcome to my server!"); } } #[main] pub fn game_main() { register!(MyGM); }
-
Build the gamemode
cargo +stable-i686 build
-
Put the compile
mygm.dll
ormygm.so
togamemodes
folder -
Goto
config.json
add following to it"rust":{ "gamemode":"mygm", }
-
Run your server