generated from bitsquid_dt/dt-plugin-template
All checks were successful
build Build for the target platform
lint/clippy Check for common mistakes and opportunities for code improvement
Also implements logging through the common `log` macros.
16 lines
371 B
Rust
16 lines
371 B
Rust
use crate::stingray_sdk::lua_State;
|
|
use crate::{LUA, global};
|
|
|
|
pub extern "C" fn do_something(l: *mut lua_State) -> i32 {
|
|
let lua = global!(LUA);
|
|
|
|
if let Some(name) = lua.tolstring(l, 1) {
|
|
lua.pushstring(
|
|
l,
|
|
format!("[do_something] Hello from Rust, {}", name.to_string_lossy()),
|
|
);
|
|
1
|
|
} else {
|
|
0
|
|
}
|
|
}
|