Skip to content

Instantly share code, notes, and snippets.

@BrettMayson
Last active December 17, 2021 20:53
Show Gist options
  • Save BrettMayson/5e6c40bd8a751adb28d49d5fe6e236f7 to your computer and use it in GitHub Desktop.
Save BrettMayson/5e6c40bd8a751adb28d49d5fe6e236f7 to your computer and use it in GitHub Desktop.
use arma_rs::{arma, Extension};
#[arma]
fn init() -> Extension {
Extension::build()
.command("side_select", side_select)
.finish()
}
fn side_select(side: String) -> Vec<String> {
match side.as_str() {
"WEST" => vec!["B_Placeholder1", "B_Placeholder2"],
"EAST" => vec!["O_Placeholder1", "O_Placeholder2"],
_ => vec!["I_Placeholder1", "I_Placeholder2"],
}.into_iter().map(|s| s.to_string()).collect()
}
("ext" callExtension ["side_select", [str _side]]) params ["_classes", "_code"];
if (_code == 0) then {
private _unitList = parseSimpleArray _classes;
} else {
WARN_1("Error encountered determining side classes: %1",_code);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment