Skip to main content

samp_sdk/omp/generated/
vehicles.rs

1//! `IVehiclesComponent` — generated by `cargo xtask gen-omp` from `Server/Components/Vehicles/vehicles.hpp`.
2//! Implemented by `VehiclesComponent` in the server's `Vehicles`.
3//!
4//! Do not edit: change `xtask/omp-wrappers.toml` or the generator and
5//! regenerate. Slots are clang's layout of the header for each ABI, checked
6//! against the official binaries by `cargo xtask check-abi --generated`.
7
8#![allow(unused_imports)]
9
10use crate::omp::containers::{FlatSet, HybridString, Pair, Span};
11use crate::omp::types::{
12    Colour, GTAQuat, Hours, Microseconds, Milliseconds, Minutes, Seconds, StringView, TimePoint,
13    UID, Vector2, Vector3, Vector4, WorldTimePoint,
14};
15use crate::omp::vtable::{call_vtable_small_struct, opaque, slots, virtual_fns};
16use crate::omp::*;
17
18slots! {
19    /// `StaticArray<uint8_t, MAX_VEHICLE_MODELS> & IVehiclesComponent::models()`
20    SLOT_MODELS: usize = 18, 16;
21    /// `IVehicle * IVehiclesComponent::create(bool, int, Vector3, float, int, int, Seconds, bool)`
22    SLOT_CREATE: usize = 19, 18;
23    /// `IVehicle * IVehiclesComponent::create(const VehicleSpawnData &)`
24    SLOT_CREATE_FROM_SPAWN_DATA: usize = 20, 17;
25}
26
27virtual_fns! {
28    /// `StaticArray<uint8_t, MAX_VEHICLE_MODELS> & IVehiclesComponent::models()`.
29    ///
30    /// # Safety
31    /// `component` must be a live `IVehiclesComponent`.
32    #[must_use]
33    pub fn vehicles_models(
34        component: IVehiclesComponent,
35    ) -> *mut [u8; 212] = [0, SLOT_MODELS] or std::ptr::null_mut();
36
37    /// `IVehicle * IVehiclesComponent::create(bool, int, Vector3, float, int, int, Seconds, bool)`.
38    ///
39    /// # Safety
40    /// `component` must be a live `IVehiclesComponent`.
41    #[must_use]
42    pub fn vehicles_create(
43        component: IVehiclesComponent,
44        is_static: bool,
45        model_id: i32,
46        position: Vector3,
47        z: f32,
48        colour1: i32,
49        colour2: i32,
50        respawn_delay: Seconds,
51        add_siren: bool,
52    ) -> *mut IVehicle = [0, SLOT_CREATE] or std::ptr::null_mut();
53
54    /// `IVehicle * IVehiclesComponent::create(const VehicleSpawnData &)`.
55    ///
56    /// # Safety
57    /// `component` must be a live `IVehiclesComponent`.
58    #[must_use]
59    pub fn vehicles_create_from_spawn_data(
60        component: IVehiclesComponent,
61        data: &VehicleSpawnData,
62    ) -> *mut IVehicle = [0, SLOT_CREATE_FROM_SPAWN_DATA] or std::ptr::null_mut();
63}
64
65// What the generator left out, and why.
66// skipped: `IEventDispatcher<VehicleEventHandler> & IVehiclesComponent::getEventDispatcher()` — `VehicleHandler` and its dispatcher are written by hand