register_sq_functions

Function register_sq_functions 

Source
pub fn register_sq_functions(get_info_func: FuncSQFuncInfo)
Expand description

Adds a sqfunction to the registration list

The sqfunction will be registered when its vm is loaded

ยงExample

#[rrplug::sqfunction(VM="Server")]
fn simple_example(name: String, player: Option<&mut CPlayer>) -> Result<(),String> {
    let _player = player.ok_or("Not a Player!".to_string())?;

    log::info!("the name is {name}");
    Ok(())
}
Examples found in repository?
examples/squirrel_example.rs (line 14)
13    fn new(_reloaded: bool) -> Self {
14        register_sq_functions(great_person);
15        register_sq_functions(call_with_random_number);
16        register_sq_functions(sum);
17
18        Self {}
19    }