call_sq_function

Macro call_sq_function 

Source
macro_rules! call_sq_function {
    ($sqvm:expr, $sqfunctions:expr, $function_name:expr, $( $arg:expr ),* ) => { ... };
}
Expand description

calls any function defined on the sqvm

this should only be called on the tf2 thread aka when concommands, convars, sqfunctions, runframe

macro version of crate::high::squirrel::call_sq_function, used to call a function with args returns Result<(), CallError>

ยงexample

  
#[rrplug::sqfunction(VM="Server")]
fn test_call_funcs() -> Result<(), String> {
    call_sq_function!(sqvm, sq_functions, "SomeSQFunc", 9347).map_err(|err| err.to_string())?;

    Ok(())
}