rust-samp-sdk 3.6.0

Low-level FFI bindings for the SA-MP AMX virtual machine and open.mp native component ABI. Used internally by `rust-samp`; depend on it directly only if you need raw access without the higher-level macros and lifecycle.
Documentation
//! `IPlayerVariableData` — generated by `cargo xtask gen-omp` from `Server/Components/Variables/variables.hpp`.
//! Implemented by `PlayerVariableData` in the server's `Variables`.
//!
//! Do not edit: change `xtask/omp-wrappers.toml` or the generator and
//! regenerate. Slots are clang's layout of the header for each ABI, checked
//! against the official binaries by `cargo xtask check-abi --generated`.

#![allow(unused_imports)]

use crate::omp::containers::{FlatSet, HybridString, Pair, Span};
use crate::omp::types::{
    Colour, GTAQuat, Hours, Microseconds, Milliseconds, Minutes, Seconds, StringView, TimePoint,
    UID, Vector2, Vector3, Vector4, WorldTimePoint,
};
use crate::omp::vtable::{call_vtable_small_struct, opaque, slots, virtual_fns};
use crate::omp::*;

opaque! {
    /// Opaque handle for `IPlayerVariableData*`.
    pub IPlayerVariableData;
}

/// `PlayerVariableData_UID` in `Server/Components/Variables/variables.hpp`.
pub const PLAYER_VARIABLES_UID: UID = 0x12debbc8a3bd23ad;

/// The player's `IPlayerVariableData`, or null when the component providing it is not loaded.
///
/// Found by walking the player's extension map for `PLAYER_VARIABLES_UID` — the
/// virtual `getExtension` does not consult that map. `IExtension`
/// is `IPlayerVariableData`'s first base, so the extension pointer is the interface pointer.
///
/// # Safety
/// `player` must be a live `IPlayer`.
#[must_use]
pub unsafe fn player_variables(player: *mut IPlayer) -> *mut IPlayerVariableData {
    unsafe { extension(player.cast::<u8>(), PLAYER_VARIABLES_UID) }.cast::<IPlayerVariableData>()
}