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
//! `IVehiclesComponent` — generated by `cargo xtask gen-omp` from `Server/Components/Vehicles/vehicles.hpp`.
//! Implemented by `VehiclesComponent` in the server's `Vehicles`.
//!
//! 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! {
    /// `StaticArray<uint8_t, MAX_VEHICLE_MODELS> & IVehiclesComponent::models()`
    SLOT_MODELS: usize = 18, 16;
    /// `IVehicle * IVehiclesComponent::create(bool, int, Vector3, float, int, int, Seconds, bool)`
    SLOT_CREATE: usize = 19, 18;
    /// `IVehicle * IVehiclesComponent::create(const VehicleSpawnData &)`
    SLOT_CREATE_FROM_SPAWN_DATA: usize = 20, 17;
}

virtual_fns! {
    /// `StaticArray<uint8_t, MAX_VEHICLE_MODELS> & IVehiclesComponent::models()`.
    ///
    /// # Safety
    /// `component` must be a live `IVehiclesComponent`.
    #[must_use]
    pub fn vehicles_models(
        component: IVehiclesComponent,
    ) -> *mut [u8; 212] = [0, SLOT_MODELS] or std::ptr::null_mut();

    /// `IVehicle * IVehiclesComponent::create(bool, int, Vector3, float, int, int, Seconds, bool)`.
    ///
    /// # Safety
    /// `component` must be a live `IVehiclesComponent`.
    #[must_use]
    pub fn vehicles_create(
        component: IVehiclesComponent,
        is_static: bool,
        model_id: i32,
        position: Vector3,
        z: f32,
        colour1: i32,
        colour2: i32,
        respawn_delay: Seconds,
        add_siren: bool,
    ) -> *mut IVehicle = [0, SLOT_CREATE] or std::ptr::null_mut();

    /// `IVehicle * IVehiclesComponent::create(const VehicleSpawnData &)`.
    ///
    /// # Safety
    /// `component` must be a live `IVehiclesComponent`.
    #[must_use]
    pub fn vehicles_create_from_spawn_data(
        component: IVehiclesComponent,
        data: &VehicleSpawnData,
    ) -> *mut IVehicle = [0, SLOT_CREATE_FROM_SPAWN_DATA] or std::ptr::null_mut();
}

// What the generator left out, and why.
// skipped: `IEventDispatcher<VehicleEventHandler> & IVehiclesComponent::getEventDispatcher()` — `VehicleHandler` and its dispatcher are written by hand