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
//! `IActor` — generated by `cargo xtask gen-omp` from `Server/Components/Actors/actors.hpp`.
//! Implemented by `Actor` in the server's `Actors`.
//!
//! 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::*;

slots! {
    /// `void IActor::setSkin(int)`
    SLOT_SET_SKIN: usize = 6, 5;
    /// `int IActor::getSkin()`
    SLOT_GET_SKIN: usize = 7, 6;
    /// `void IActor::applyAnimation(const AnimationData &)`
    SLOT_APPLY_ANIMATION: usize = 8, 7;
    /// `const AnimationData & IActor::getAnimation()`
    SLOT_GET_ANIMATION: usize = 9, 8;
    /// `void IActor::clearAnimations()`
    SLOT_CLEAR_ANIMATIONS: usize = 10, 9;
    /// `void IActor::setHealth(float)`
    SLOT_SET_HEALTH: usize = 11, 10;
    /// `float IActor::getHealth()`
    SLOT_GET_HEALTH: usize = 12, 11;
    /// `void IActor::setInvulnerable(bool)`
    SLOT_SET_INVULNERABLE: usize = 13, 12;
    /// `bool IActor::isInvulnerable()`
    SLOT_IS_INVULNERABLE: usize = 14, 13;
    /// `bool IActor::isStreamedInForPlayer(const IPlayer &)`
    SLOT_IS_STREAMED_IN_FOR_PLAYER: usize = 15, 14;
    /// `void IActor::streamInForPlayer(IPlayer &)`
    SLOT_STREAM_IN_FOR_PLAYER: usize = 16, 15;
    /// `void IActor::streamOutForPlayer(IPlayer &)`
    SLOT_STREAM_OUT_FOR_PLAYER: usize = 17, 16;
    /// `const ActorSpawnData & IActor::getSpawnData()`
    SLOT_GET_SPAWN_DATA: usize = 18, 17;
}

virtual_fns! {
    /// `void IActor::setSkin(int)`.
    ///
    /// # Safety
    /// `actor` must be a live `IActor`.
    pub fn actor_set_skin(actor: IActor, id: i32) = [0, SLOT_SET_SKIN];

    /// `int IActor::getSkin()`.
    ///
    /// # Safety
    /// `actor` must be a live `IActor`.
    #[must_use]
    pub fn actor_skin(actor: IActor) -> i32 = [0, SLOT_GET_SKIN] or 0;

    /// `void IActor::applyAnimation(const AnimationData &)`.
    ///
    /// # Safety
    /// `actor` must be a live `IActor`.
    pub fn actor_apply_animation(
        actor: IActor,
        animation: &AnimationData,
    ) = [0, SLOT_APPLY_ANIMATION];

    /// `const AnimationData & IActor::getAnimation()`.
    ///
    /// # Safety
    /// `actor` must be a live `IActor`.
    #[must_use]
    pub fn actor_animation(
        actor: IActor,
    ) -> *const AnimationData = [0, SLOT_GET_ANIMATION] or std::ptr::null();

    /// `void IActor::clearAnimations()`.
    ///
    /// # Safety
    /// `actor` must be a live `IActor`.
    pub fn actor_clear_animations(actor: IActor) = [0, SLOT_CLEAR_ANIMATIONS];

    /// `void IActor::setHealth(float)`.
    ///
    /// # Safety
    /// `actor` must be a live `IActor`.
    pub fn actor_set_health(actor: IActor, health: f32) = [0, SLOT_SET_HEALTH];

    /// `float IActor::getHealth()`.
    ///
    /// # Safety
    /// `actor` must be a live `IActor`.
    #[must_use]
    pub fn actor_health(actor: IActor) -> f32 = [0, SLOT_GET_HEALTH] or 0.0;

    /// `void IActor::setInvulnerable(bool)`.
    ///
    /// # Safety
    /// `actor` must be a live `IActor`.
    pub fn actor_set_invulnerable(actor: IActor, invuln: bool) = [0, SLOT_SET_INVULNERABLE];

    /// `bool IActor::isInvulnerable()`.
    ///
    /// # Safety
    /// `actor` must be a live `IActor`.
    #[must_use]
    pub fn actor_is_invulnerable(actor: IActor) -> bool = [0, SLOT_IS_INVULNERABLE] or false;

    /// `bool IActor::isStreamedInForPlayer(const IPlayer &)`.
    ///
    /// # Safety
    /// `actor` must be a live `IActor`.
    #[must_use]
    pub fn actor_is_streamed_in_for_player(
        actor: IActor,
        player: *mut IPlayer,
    ) -> bool = [0, SLOT_IS_STREAMED_IN_FOR_PLAYER] or false;

    /// `void IActor::streamInForPlayer(IPlayer &)`.
    ///
    /// # Safety
    /// `actor` must be a live `IActor`.
    pub fn actor_stream_in_for_player(
        actor: IActor,
        player: *mut IPlayer,
    ) = [0, SLOT_STREAM_IN_FOR_PLAYER];

    /// `void IActor::streamOutForPlayer(IPlayer &)`.
    ///
    /// # Safety
    /// `actor` must be a live `IActor`.
    pub fn actor_stream_out_for_player(
        actor: IActor,
        player: *mut IPlayer,
    ) = [0, SLOT_STREAM_OUT_FOR_PLAYER];

    /// `const ActorSpawnData & IActor::getSpawnData()`.
    ///
    /// # Safety
    /// `actor` must be a live `IActor`.
    #[must_use]
    pub fn actor_spawn_data(
        actor: IActor,
    ) -> *const ActorSpawnData = [0, SLOT_GET_SPAWN_DATA] or std::ptr::null();
}