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
//! `IGangZone` — generated by `cargo xtask gen-omp` from `Server/Components/GangZones/gangzones.hpp`.
//! Implemented by `GangZone` in the server's `GangZones`.
//!
//! 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! {
    /// `bool IBaseGangZone::isShownForPlayer(const IPlayer &)`
    SLOT_IS_SHOWN_FOR_PLAYER: usize = 6, 5;
    /// `bool IBaseGangZone::isFlashingForPlayer(const IPlayer &)`
    SLOT_IS_FLASHING_FOR_PLAYER: usize = 7, 6;
    /// `void IBaseGangZone::showForPlayer(IPlayer &, const Colour &)`
    SLOT_SHOW_FOR_PLAYER: usize = 8, 7;
    /// `void IBaseGangZone::hideForPlayer(IPlayer &)`
    SLOT_HIDE_FOR_PLAYER: usize = 9, 8;
    /// `void IBaseGangZone::flashForPlayer(IPlayer &, const Colour &)`
    SLOT_FLASH_FOR_PLAYER: usize = 10, 9;
    /// `void IBaseGangZone::stopFlashForPlayer(IPlayer &)`
    SLOT_STOP_FLASH_FOR_PLAYER: usize = 11, 10;
    /// `GangZonePos IBaseGangZone::getPosition()`
    SLOT_GET_POSITION: usize = 12, 11;
    /// `void IBaseGangZone::setPosition(const GangZonePos &)`
    SLOT_SET_POSITION: usize = 13, 12;
    /// `bool IBaseGangZone::isPlayerInside(const IPlayer &)`
    SLOT_IS_PLAYER_INSIDE: usize = 14, 13;
    /// `const FlatHashSet<IPlayer *> & IBaseGangZone::getShownFor()`
    SLOT_GET_SHOWN_FOR: usize = 15, 14;
    /// `const Colour IBaseGangZone::getFlashingColourForPlayer(IPlayer &)`
    SLOT_GET_FLASHING_COLOUR_FOR_PLAYER: usize = 16, 15;
    /// `const Colour IBaseGangZone::getColourForPlayer(IPlayer &)`
    SLOT_GET_COLOUR_FOR_PLAYER: usize = 17, 16;
    /// `void IBaseGangZone::setLegacyPlayer(IPlayer *)`
    SLOT_SET_LEGACY_PLAYER: usize = 18, 17;
    /// `IPlayer * IBaseGangZone::getLegacyPlayer()`
    SLOT_GET_LEGACY_PLAYER: usize = 19, 18;
}

virtual_fns! {
    /// `bool IBaseGangZone::isShownForPlayer(const IPlayer &)`.
    ///
    /// # Safety
    /// `gangzone` must be a live `IGangZone`.
    #[must_use]
    pub fn gangzone_is_shown_for_player(
        gangzone: IGangZone,
        player: *mut IPlayer,
    ) -> bool = [0, SLOT_IS_SHOWN_FOR_PLAYER] or false;

    /// `bool IBaseGangZone::isFlashingForPlayer(const IPlayer &)`.
    ///
    /// # Safety
    /// `gangzone` must be a live `IGangZone`.
    #[must_use]
    pub fn gangzone_is_flashing_for_player(
        gangzone: IGangZone,
        player: *mut IPlayer,
    ) -> bool = [0, SLOT_IS_FLASHING_FOR_PLAYER] or false;

    /// `void IBaseGangZone::showForPlayer(IPlayer &, const Colour &)`.
    ///
    /// # Safety
    /// `gangzone` must be a live `IGangZone`.
    pub fn gangzone_show_for_player(
        gangzone: IGangZone,
        player: *mut IPlayer,
        colour: &Colour,
    ) = [0, SLOT_SHOW_FOR_PLAYER];

    /// `void IBaseGangZone::hideForPlayer(IPlayer &)`.
    ///
    /// # Safety
    /// `gangzone` must be a live `IGangZone`.
    pub fn gangzone_hide_for_player(
        gangzone: IGangZone,
        player: *mut IPlayer,
    ) = [0, SLOT_HIDE_FOR_PLAYER];

    /// `void IBaseGangZone::flashForPlayer(IPlayer &, const Colour &)`.
    ///
    /// # Safety
    /// `gangzone` must be a live `IGangZone`.
    pub fn gangzone_flash_for_player(
        gangzone: IGangZone,
        player: *mut IPlayer,
        colour: &Colour,
    ) = [0, SLOT_FLASH_FOR_PLAYER];

    /// `void IBaseGangZone::stopFlashForPlayer(IPlayer &)`.
    ///
    /// # Safety
    /// `gangzone` must be a live `IGangZone`.
    pub fn gangzone_stop_flash_for_player(
        gangzone: IGangZone,
        player: *mut IPlayer,
    ) = [0, SLOT_STOP_FLASH_FOR_PLAYER];

    /// `GangZonePos IBaseGangZone::getPosition()`.
    ///
    /// # Safety
    /// `gangzone` must be a live `IGangZone`.
    #[must_use]
    pub fn gangzone_position(
        gangzone: IGangZone,
    ) -> GangZonePos = [0, SLOT_GET_POSITION] or GangZonePos::default();

    /// `void IBaseGangZone::setPosition(const GangZonePos &)`.
    ///
    /// # Safety
    /// `gangzone` must be a live `IGangZone`.
    pub fn gangzone_set_position(
        gangzone: IGangZone,
        position: &GangZonePos,
    ) = [0, SLOT_SET_POSITION];

    /// `bool IBaseGangZone::isPlayerInside(const IPlayer &)`.
    ///
    /// # Safety
    /// `gangzone` must be a live `IGangZone`.
    #[must_use]
    pub fn gangzone_is_player_inside(
        gangzone: IGangZone,
        player: *mut IPlayer,
    ) -> bool = [0, SLOT_IS_PLAYER_INSIDE] or false;

    /// `const FlatHashSet<IPlayer *> & IBaseGangZone::getShownFor()`.
    ///
    /// # Safety
    /// `gangzone` must be a live `IGangZone`.
    #[must_use]
    pub fn gangzone_shown_for(
        gangzone: IGangZone,
    ) -> *const FlatSet<IPlayer> = [0, SLOT_GET_SHOWN_FOR] or std::ptr::null();

    /// `void IBaseGangZone::setLegacyPlayer(IPlayer *)`.
    ///
    /// # Safety
    /// `gangzone` must be a live `IGangZone`.
    pub fn gangzone_set_legacy_player(
        gangzone: IGangZone,
        player: *mut IPlayer,
    ) = [0, SLOT_SET_LEGACY_PLAYER];

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

/// `const Colour IBaseGangZone::getFlashingColourForPlayer(IPlayer &)`.
///
/// # Safety
/// `gangzone` must be a live `IGangZone`.
#[must_use]
pub unsafe fn gangzone_flashing_colour_for_player(
    gangzone: *mut IGangZone,
    player: *mut IPlayer,
) -> Option<Colour> {
    call_vtable_small_struct!(gangzone.cast::<u8>(), 0, SLOT_GET_FLASHING_COLOUR_FOR_PLAYER, Colour, Colour::default(), (*mut IPlayer) (player))
}

/// `const Colour IBaseGangZone::getColourForPlayer(IPlayer &)`.
///
/// # Safety
/// `gangzone` must be a live `IGangZone`.
#[must_use]
pub unsafe fn gangzone_colour_for_player(
    gangzone: *mut IGangZone,
    player: *mut IPlayer,
) -> Option<Colour> {
    call_vtable_small_struct!(gangzone.cast::<u8>(), 0, SLOT_GET_COLOUR_FOR_PLAYER, Colour, Colour::default(), (*mut IPlayer) (player))
}