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

/// `PlayerTextLabelData_UID` in `Server/Components/TextLabels/textlabels.hpp`.
pub const PLAYER_TEXTLABELS_UID: UID = 0xb9e2bd0dc5148c3c;

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

slots! {
    /// `IPlayerTextLabel * IPlayerTextLabelData::create(StringView, Colour, Vector3, float, bool)`
    SLOT_CREATE: usize = 3, 5;
    /// `IPlayerTextLabel * IPlayerTextLabelData::create(StringView, Colour, Vector3, float, bool, IPlayer &)`
    SLOT_CREATE_ON_PLAYER: usize = 4, 4;
    /// `IPlayerTextLabel * IPlayerTextLabelData::create(StringView, Colour, Vector3, float, bool, IVehicle &)`
    SLOT_CREATE_ON_VEHICLE: usize = 5, 3;
}

virtual_fns! {
    /// `IPlayerTextLabel * IPlayerTextLabelData::create(StringView, Colour, Vector3, float, bool)`.
    ///
    /// # Safety
    /// `data` must be a live `IPlayerTextLabelData`.
    #[must_use]
    pub fn player_textlabels_create(
        data: IPlayerTextLabelData,
        text: StringView,
        colour: Colour,
        pos: Vector3,
        draw_dist: f32,
        los: bool,
    ) -> *mut IPlayerTextLabel = [0, SLOT_CREATE] or std::ptr::null_mut();

    /// `IPlayerTextLabel * IPlayerTextLabelData::create(StringView, Colour, Vector3, float, bool, IPlayer &)`.
    ///
    /// # Safety
    /// `data` must be a live `IPlayerTextLabelData`.
    #[must_use]
    pub fn player_textlabels_create_on_player(
        data: IPlayerTextLabelData,
        text: StringView,
        colour: Colour,
        pos: Vector3,
        draw_dist: f32,
        los: bool,
        attach: *mut IPlayer,
    ) -> *mut IPlayerTextLabel = [0, SLOT_CREATE_ON_PLAYER] or std::ptr::null_mut();

    /// `IPlayerTextLabel * IPlayerTextLabelData::create(StringView, Colour, Vector3, float, bool, IVehicle &)`.
    ///
    /// # Safety
    /// `data` must be a live `IPlayerTextLabelData`.
    #[must_use]
    pub fn player_textlabels_create_on_vehicle(
        data: IPlayerTextLabelData,
        text: StringView,
        colour: Colour,
        pos: Vector3,
        draw_dist: f32,
        los: bool,
        attach: *mut IVehicle,
    ) -> *mut IPlayerTextLabel = [0, SLOT_CREATE_ON_VEHICLE] or std::ptr::null_mut();
}