Skip to main content

samp_sdk/omp/generated/
actor.rs

1//! `IActor` — generated by `cargo xtask gen-omp` from `Server/Components/Actors/actors.hpp`.
2//! Implemented by `Actor` in the server's `Actors`.
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    /// `void IActor::setSkin(int)`
20    SLOT_SET_SKIN: usize = 6, 5;
21    /// `int IActor::getSkin()`
22    SLOT_GET_SKIN: usize = 7, 6;
23    /// `void IActor::applyAnimation(const AnimationData &)`
24    SLOT_APPLY_ANIMATION: usize = 8, 7;
25    /// `const AnimationData & IActor::getAnimation()`
26    SLOT_GET_ANIMATION: usize = 9, 8;
27    /// `void IActor::clearAnimations()`
28    SLOT_CLEAR_ANIMATIONS: usize = 10, 9;
29    /// `void IActor::setHealth(float)`
30    SLOT_SET_HEALTH: usize = 11, 10;
31    /// `float IActor::getHealth()`
32    SLOT_GET_HEALTH: usize = 12, 11;
33    /// `void IActor::setInvulnerable(bool)`
34    SLOT_SET_INVULNERABLE: usize = 13, 12;
35    /// `bool IActor::isInvulnerable()`
36    SLOT_IS_INVULNERABLE: usize = 14, 13;
37    /// `bool IActor::isStreamedInForPlayer(const IPlayer &)`
38    SLOT_IS_STREAMED_IN_FOR_PLAYER: usize = 15, 14;
39    /// `void IActor::streamInForPlayer(IPlayer &)`
40    SLOT_STREAM_IN_FOR_PLAYER: usize = 16, 15;
41    /// `void IActor::streamOutForPlayer(IPlayer &)`
42    SLOT_STREAM_OUT_FOR_PLAYER: usize = 17, 16;
43    /// `const ActorSpawnData & IActor::getSpawnData()`
44    SLOT_GET_SPAWN_DATA: usize = 18, 17;
45}
46
47virtual_fns! {
48    /// `void IActor::setSkin(int)`.
49    ///
50    /// # Safety
51    /// `actor` must be a live `IActor`.
52    pub fn actor_set_skin(actor: IActor, id: i32) = [0, SLOT_SET_SKIN];
53
54    /// `int IActor::getSkin()`.
55    ///
56    /// # Safety
57    /// `actor` must be a live `IActor`.
58    #[must_use]
59    pub fn actor_skin(actor: IActor) -> i32 = [0, SLOT_GET_SKIN] or 0;
60
61    /// `void IActor::applyAnimation(const AnimationData &)`.
62    ///
63    /// # Safety
64    /// `actor` must be a live `IActor`.
65    pub fn actor_apply_animation(
66        actor: IActor,
67        animation: &AnimationData,
68    ) = [0, SLOT_APPLY_ANIMATION];
69
70    /// `const AnimationData & IActor::getAnimation()`.
71    ///
72    /// # Safety
73    /// `actor` must be a live `IActor`.
74    #[must_use]
75    pub fn actor_animation(
76        actor: IActor,
77    ) -> *const AnimationData = [0, SLOT_GET_ANIMATION] or std::ptr::null();
78
79    /// `void IActor::clearAnimations()`.
80    ///
81    /// # Safety
82    /// `actor` must be a live `IActor`.
83    pub fn actor_clear_animations(actor: IActor) = [0, SLOT_CLEAR_ANIMATIONS];
84
85    /// `void IActor::setHealth(float)`.
86    ///
87    /// # Safety
88    /// `actor` must be a live `IActor`.
89    pub fn actor_set_health(actor: IActor, health: f32) = [0, SLOT_SET_HEALTH];
90
91    /// `float IActor::getHealth()`.
92    ///
93    /// # Safety
94    /// `actor` must be a live `IActor`.
95    #[must_use]
96    pub fn actor_health(actor: IActor) -> f32 = [0, SLOT_GET_HEALTH] or 0.0;
97
98    /// `void IActor::setInvulnerable(bool)`.
99    ///
100    /// # Safety
101    /// `actor` must be a live `IActor`.
102    pub fn actor_set_invulnerable(actor: IActor, invuln: bool) = [0, SLOT_SET_INVULNERABLE];
103
104    /// `bool IActor::isInvulnerable()`.
105    ///
106    /// # Safety
107    /// `actor` must be a live `IActor`.
108    #[must_use]
109    pub fn actor_is_invulnerable(actor: IActor) -> bool = [0, SLOT_IS_INVULNERABLE] or false;
110
111    /// `bool IActor::isStreamedInForPlayer(const IPlayer &)`.
112    ///
113    /// # Safety
114    /// `actor` must be a live `IActor`.
115    #[must_use]
116    pub fn actor_is_streamed_in_for_player(
117        actor: IActor,
118        player: *mut IPlayer,
119    ) -> bool = [0, SLOT_IS_STREAMED_IN_FOR_PLAYER] or false;
120
121    /// `void IActor::streamInForPlayer(IPlayer &)`.
122    ///
123    /// # Safety
124    /// `actor` must be a live `IActor`.
125    pub fn actor_stream_in_for_player(
126        actor: IActor,
127        player: *mut IPlayer,
128    ) = [0, SLOT_STREAM_IN_FOR_PLAYER];
129
130    /// `void IActor::streamOutForPlayer(IPlayer &)`.
131    ///
132    /// # Safety
133    /// `actor` must be a live `IActor`.
134    pub fn actor_stream_out_for_player(
135        actor: IActor,
136        player: *mut IPlayer,
137    ) = [0, SLOT_STREAM_OUT_FOR_PLAYER];
138
139    /// `const ActorSpawnData & IActor::getSpawnData()`.
140    ///
141    /// # Safety
142    /// `actor` must be a live `IActor`.
143    #[must_use]
144    pub fn actor_spawn_data(
145        actor: IActor,
146    ) -> *const ActorSpawnData = [0, SLOT_GET_SPAWN_DATA] or std::ptr::null();
147}