omp_gdk/scripting/classes/
events.rs1#![allow(clippy::all)]
2use crate::{events::EventArgs, players::Player, runtime::each_module};
3
4#[repr(C)]
5pub struct OnPlayerRequestClassArgs {
6 player: *const *const std::ffi::c_void,
7 classId: *const i32,
8}
9
10#[no_mangle]
11pub unsafe extern "C" fn OMPRS_OnPlayerRequestClass(
12 args: *const EventArgs<OnPlayerRequestClassArgs>,
13) -> bool {
14 each_module(move |mut script| {
15 Some(script.on_player_request_class(
16 Player::new(*(*(*args).list).player),
17 *(*(*args).list).classId,
18 ))
19 })
20 .unwrap()
21}