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
//! `IPickup` — generated by `cargo xtask gen-omp` from `Server/Components/Pickups/pickups.hpp`.
//! Implemented by `Pickup` in the server's `Pickups`.
//!
//! 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 IBasePickup::setType(PickupType, bool)`
    SLOT_SET_TYPE: usize = 6, 5;
    /// `PickupType IBasePickup::getType()`
    SLOT_GET_TYPE: usize = 7, 6;
    /// `void IBasePickup::setPositionNoUpdate(Vector3)`
    SLOT_SET_POSITION_NO_UPDATE: usize = 8, 7;
    /// `void IBasePickup::setModel(int, bool)`
    SLOT_SET_MODEL: usize = 9, 8;
    /// `int IBasePickup::getModel()`
    SLOT_GET_MODEL: usize = 10, 9;
    /// `bool IBasePickup::isStreamedInForPlayer(const IPlayer &)`
    SLOT_IS_STREAMED_IN_FOR_PLAYER: usize = 11, 10;
    /// `void IBasePickup::streamInForPlayer(IPlayer &)`
    SLOT_STREAM_IN_FOR_PLAYER: usize = 12, 11;
    /// `void IBasePickup::streamOutForPlayer(IPlayer &)`
    SLOT_STREAM_OUT_FOR_PLAYER: usize = 13, 12;
    /// `void IBasePickup::setPickupHiddenForPlayer(IPlayer &, bool)`
    SLOT_SET_PICKUP_HIDDEN_FOR_PLAYER: usize = 14, 13;
    /// `bool IBasePickup::isPickupHiddenForPlayer(IPlayer &)`
    SLOT_IS_PICKUP_HIDDEN_FOR_PLAYER: usize = 15, 14;
    /// `void IBasePickup::setLegacyPlayer(IPlayer *)`
    SLOT_SET_LEGACY_PLAYER: usize = 16, 15;
    /// `IPlayer * IBasePickup::getLegacyPlayer()`
    SLOT_GET_LEGACY_PLAYER: usize = 17, 16;
}

virtual_fns! {
    /// `void IBasePickup::setType(PickupType, bool)`.
    ///
    /// # Safety
    /// `pickup` must be a live `IPickup`.
    pub fn pickup_set_type(pickup: IPickup, type_value: u8, update: bool) = [0, SLOT_SET_TYPE];

    /// `PickupType IBasePickup::getType()`.
    ///
    /// # Safety
    /// `pickup` must be a live `IPickup`.
    #[must_use]
    pub fn pickup_type(pickup: IPickup) -> u8 = [0, SLOT_GET_TYPE] or 0;

    /// `void IBasePickup::setPositionNoUpdate(Vector3)`.
    ///
    /// # Safety
    /// `pickup` must be a live `IPickup`.
    pub fn pickup_set_position_no_update(
        pickup: IPickup,
        position: Vector3,
    ) = [0, SLOT_SET_POSITION_NO_UPDATE];

    /// `void IBasePickup::setModel(int, bool)`.
    ///
    /// # Safety
    /// `pickup` must be a live `IPickup`.
    pub fn pickup_set_model(pickup: IPickup, id: i32, update: bool) = [0, SLOT_SET_MODEL];

    /// `int IBasePickup::getModel()`.
    ///
    /// # Safety
    /// `pickup` must be a live `IPickup`.
    #[must_use]
    pub fn pickup_model(pickup: IPickup) -> i32 = [0, SLOT_GET_MODEL] or 0;

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

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

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

    /// `void IBasePickup::setPickupHiddenForPlayer(IPlayer &, bool)`.
    ///
    /// # Safety
    /// `pickup` must be a live `IPickup`.
    pub fn pickup_set_pickup_hidden_for_player(
        pickup: IPickup,
        player: *mut IPlayer,
        hidden: bool,
    ) = [0, SLOT_SET_PICKUP_HIDDEN_FOR_PLAYER];

    /// `bool IBasePickup::isPickupHiddenForPlayer(IPlayer &)`.
    ///
    /// # Safety
    /// `pickup` must be a live `IPickup`.
    #[must_use]
    pub fn pickup_is_pickup_hidden_for_player(
        pickup: IPickup,
        player: *mut IPlayer,
    ) -> bool = [0, SLOT_IS_PICKUP_HIDDEN_FOR_PLAYER] or false;

    /// `void IBasePickup::setLegacyPlayer(IPlayer *)`.
    ///
    /// # Safety
    /// `pickup` must be a live `IPickup`.
    pub fn pickup_set_legacy_player(
        pickup: IPickup,
        player: *mut IPlayer,
    ) = [0, SLOT_SET_LEGACY_PLAYER];

    /// `IPlayer * IBasePickup::getLegacyPlayer()`.
    ///
    /// # Safety
    /// `pickup` must be a live `IPickup`.
    #[must_use]
    pub fn pickup_legacy_player(
        pickup: IPickup,
    ) -> *mut IPlayer = [0, SLOT_GET_LEGACY_PLAYER] or std::ptr::null_mut();
}