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
//! `IPlayerCheckpointData` — generated by `cargo xtask gen-omp` from `Server/Components/Checkpoints/checkpoints.hpp`.
//! Implemented by `PlayerCheckpointData` in the server's `Checkpoints`.
//!
//! 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 `IPlayerCheckpointData*`.
    pub IPlayerCheckpointData;
}

/// `PlayerCheckpointData_UID` in `Server/Components/Checkpoints/checkpoints.hpp`.
pub const PLAYER_CHECKPOINTS_UID: UID = 0xbc07576aa3591a66;

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

slots! {
    /// `IRaceCheckpointData & IPlayerCheckpointData::getRaceCheckpoint()`
    SLOT_GET_RACE_CHECKPOINT: usize = 3, 3;
    /// `ICheckpointData & IPlayerCheckpointData::getCheckpoint()`
    SLOT_GET_CHECKPOINT: usize = 4, 4;
}

virtual_fns! {
    /// `IRaceCheckpointData & IPlayerCheckpointData::getRaceCheckpoint()`.
    ///
    /// # Safety
    /// `data` must be a live `IPlayerCheckpointData`.
    #[must_use]
    pub fn player_checkpoints_race_checkpoint(
        data: IPlayerCheckpointData,
    ) -> *mut IRaceCheckpointData = [0, SLOT_GET_RACE_CHECKPOINT] or std::ptr::null_mut();

    /// `ICheckpointData & IPlayerCheckpointData::getCheckpoint()`.
    ///
    /// # Safety
    /// `data` must be a live `IPlayerCheckpointData`.
    #[must_use]
    pub fn player_checkpoints_checkpoint(
        data: IPlayerCheckpointData,
    ) -> *mut ICheckpointData = [0, SLOT_GET_CHECKPOINT] or std::ptr::null_mut();
}