Skip to content

0.1.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@Sreyas-Sreelal Sreyas-Sreelal released this 06 May 16:31
· 34 commits to master since this release

First Release of OMPRS

Writing my first gamemode in Rust

  1. Download the omprs component from here

  2. Place the Rust.dll or Rust.so component in components folder

  3. Create a new rust project
    cargo new mygm --lib

  4. Add omp to dependecies
    cargo add omp

  5. Add this to your Cargo.toml

    [lib]
    crate-type = ["cdylib"]
  6. 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);
    }
  7. Build the gamemode

    cargo +stable-i686 build

  8. Put the compile mygm.dll or mygm.so to gamemodes folder

  9. Goto config.json add following to it

    "rust":{
        "gamemode":"mygm",
    }
  10. Run your server