samp_sdk/omp/generated/vehicle.rs
1//! `IVehicle` — generated by `cargo xtask gen-omp` from `Server/Components/Vehicles/vehicles.hpp`.
2//! Implemented by `Vehicle` 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 /// `void IVehicle::setSpawnData(const VehicleSpawnData &)`
20 SLOT_SET_SPAWN_DATA: usize = 6, 5;
21 /// `const VehicleSpawnData & IVehicle::getSpawnData()`
22 SLOT_GET_SPAWN_DATA: usize = 7, 6;
23 /// `bool IVehicle::isStreamedInForPlayer(const IPlayer &)`
24 SLOT_IS_STREAMED_IN_FOR_PLAYER: usize = 8, 7;
25 /// `void IVehicle::streamInForPlayer(IPlayer &)`
26 SLOT_STREAM_IN_FOR_PLAYER: usize = 9, 8;
27 /// `void IVehicle::streamOutForPlayer(IPlayer &)`
28 SLOT_STREAM_OUT_FOR_PLAYER: usize = 10, 9;
29 /// `Pair<int, int> IVehicle::getColour()`
30 SLOT_GET_COLOUR: usize = 12, 11;
31 /// `bool IVehicle::updateFromDriverSync(const VehicleDriverSyncPacket &, IPlayer &)`
32 SLOT_UPDATE_FROM_DRIVER_SYNC: usize = 15, 14;
33 /// `bool IVehicle::updateFromPassengerSync(const VehiclePassengerSyncPacket &, IPlayer &)`
34 SLOT_UPDATE_FROM_PASSENGER_SYNC: usize = 16, 15;
35 /// `bool IVehicle::updateFromUnoccupied(const VehicleUnoccupiedSyncPacket &, IPlayer &)`
36 SLOT_UPDATE_FROM_UNOCCUPIED: usize = 17, 16;
37 /// `bool IVehicle::updateFromTrailerSync(const VehicleTrailerSyncPacket &, IPlayer &)`
38 SLOT_UPDATE_FROM_TRAILER_SYNC: usize = 18, 17;
39 /// `const FlatPtrHashSet<IPlayer> & IVehicle::streamedForPlayers()`
40 SLOT_STREAMED_FOR_PLAYERS: usize = 19, 18;
41 /// `IPlayer * IVehicle::getDriver()`
42 SLOT_GET_DRIVER: usize = 20, 19;
43 /// `const FlatHashSet<IPlayer *> & IVehicle::getPassengers()`
44 SLOT_GET_PASSENGERS: usize = 21, 20;
45 /// `void IVehicle::setPlate(StringView)`
46 SLOT_SET_PLATE: usize = 22, 21;
47 /// `const StringView IVehicle::getPlate()`
48 SLOT_GET_PLATE: usize = 23, 22;
49 /// `void IVehicle::setDamageStatus(int, int, uint8_t, uint8_t, IPlayer *)`
50 SLOT_SET_DAMAGE_STATUS: usize = 24, 23;
51 /// `void IVehicle::getDamageStatus(int &, int &, int &, int &)`
52 SLOT_GET_DAMAGE_STATUS: usize = 25, 24;
53 /// `void IVehicle::setPaintJob(int)`
54 SLOT_SET_PAINT_JOB: usize = 26, 25;
55 /// `int IVehicle::getPaintJob()`
56 SLOT_GET_PAINT_JOB: usize = 27, 26;
57 /// `void IVehicle::addComponent(int)`
58 SLOT_ADD_COMPONENT: usize = 28, 27;
59 /// `int IVehicle::getComponentInSlot(int)`
60 SLOT_GET_COMPONENT_IN_SLOT: usize = 29, 28;
61 /// `void IVehicle::removeComponent(int)`
62 SLOT_REMOVE_COMPONENT: usize = 30, 29;
63 /// `void IVehicle::putPlayer(IPlayer &, int)`
64 SLOT_PUT_PLAYER: usize = 31, 30;
65 /// `void IVehicle::setZAngle(float)`
66 SLOT_SET_Z_ANGLE: usize = 32, 31;
67 /// `float IVehicle::getZAngle()`
68 SLOT_GET_Z_ANGLE: usize = 33, 32;
69 /// `void IVehicle::setParams(const VehicleParams &)`
70 SLOT_SET_PARAMS: usize = 34, 33;
71 /// `void IVehicle::setParamsForPlayer(IPlayer &, const VehicleParams &)`
72 SLOT_SET_PARAMS_FOR_PLAYER: usize = 35, 34;
73 /// `const VehicleParams & IVehicle::getParams()`
74 SLOT_GET_PARAMS: usize = 36, 35;
75 /// `bool IVehicle::isDead()`
76 SLOT_IS_DEAD: usize = 37, 36;
77 /// `void IVehicle::respawn()`
78 SLOT_RESPAWN: usize = 38, 37;
79 /// `Seconds IVehicle::getRespawnDelay()`
80 SLOT_GET_RESPAWN_DELAY: usize = 39, 38;
81 /// `void IVehicle::setRespawnDelay(Seconds)`
82 SLOT_SET_RESPAWN_DELAY: usize = 40, 39;
83 /// `bool IVehicle::isRespawning()`
84 SLOT_IS_RESPAWNING: usize = 41, 40;
85 /// `void IVehicle::setInterior(int)`
86 SLOT_SET_INTERIOR: usize = 42, 41;
87 /// `int IVehicle::getInterior()`
88 SLOT_GET_INTERIOR: usize = 43, 42;
89 /// `void IVehicle::attachTrailer(IVehicle &)`
90 SLOT_ATTACH_TRAILER: usize = 44, 43;
91 /// `void IVehicle::detachTrailer()`
92 SLOT_DETACH_TRAILER: usize = 45, 44;
93 /// `bool IVehicle::isTrailer()`
94 SLOT_IS_TRAILER: usize = 46, 45;
95 /// `IVehicle * IVehicle::getTrailer()`
96 SLOT_GET_TRAILER: usize = 47, 46;
97 /// `IVehicle * IVehicle::getCab()`
98 SLOT_GET_CAB: usize = 48, 47;
99 /// `void IVehicle::repair()`
100 SLOT_REPAIR: usize = 49, 48;
101 /// `void IVehicle::addCarriage(IVehicle *, int)`
102 SLOT_ADD_CARRIAGE: usize = 50, 49;
103 /// `void IVehicle::updateCarriage(Vector3, Vector3)`
104 SLOT_UPDATE_CARRIAGE: usize = 51, 50;
105 /// `const StaticArray<IVehicle *, MAX_VEHICLE_CARRIAGES> & IVehicle::getCarriages()`
106 SLOT_GET_CARRIAGES: usize = 52, 51;
107 /// `void IVehicle::setVelocity(Vector3)`
108 SLOT_SET_VELOCITY: usize = 53, 52;
109 /// `Vector3 IVehicle::getVelocity()`
110 SLOT_GET_VELOCITY: usize = 54, 53;
111 /// `void IVehicle::setAngularVelocity(Vector3)`
112 SLOT_SET_ANGULAR_VELOCITY: usize = 55, 54;
113 /// `Vector3 IVehicle::getAngularVelocity()`
114 SLOT_GET_ANGULAR_VELOCITY: usize = 56, 55;
115 /// `uint8_t IVehicle::getLandingGearState()`
116 SLOT_GET_LANDING_GEAR_STATE: usize = 58, 57;
117 /// `bool IVehicle::hasBeenOccupied()`
118 SLOT_HAS_BEEN_OCCUPIED: usize = 59, 58;
119 /// `const TimePoint & IVehicle::getLastOccupiedTime()`
120 SLOT_GET_LAST_OCCUPIED_TIME: usize = 60, 59;
121 /// `const TimePoint & IVehicle::getLastSpawnTime()`
122 SLOT_GET_LAST_SPAWN_TIME: usize = 61, 60;
123 /// `bool IVehicle::isOccupied()`
124 SLOT_IS_OCCUPIED: usize = 62, 61;
125 /// `void IVehicle::setSiren(bool)`
126 SLOT_SET_SIREN: usize = 63, 62;
127 /// `uint8_t IVehicle::getSirenState()`
128 SLOT_GET_SIREN_STATE: usize = 64, 63;
129 /// `uint32_t IVehicle::getHydraThrustAngle()`
130 SLOT_GET_HYDRA_THRUST_ANGLE: usize = 65, 64;
131 /// `float IVehicle::getTrainSpeed()`
132 SLOT_GET_TRAIN_SPEED: usize = 66, 65;
133 /// `int IVehicle::getLastDriverPoolID()`
134 SLOT_GET_LAST_DRIVER_POOL_ID: usize = 67, 66;
135}
136
137virtual_fns! {
138 /// `void IVehicle::setSpawnData(const VehicleSpawnData &)`.
139 ///
140 /// # Safety
141 /// `vehicle` must be a live `IVehicle`.
142 pub fn vehicle_set_spawn_data(
143 vehicle: IVehicle,
144 data: &VehicleSpawnData,
145 ) = [0, SLOT_SET_SPAWN_DATA];
146
147 /// `const VehicleSpawnData & IVehicle::getSpawnData()`.
148 ///
149 /// # Safety
150 /// `vehicle` must be a live `IVehicle`.
151 #[must_use]
152 pub fn vehicle_spawn_data(
153 vehicle: IVehicle,
154 ) -> *const VehicleSpawnData = [0, SLOT_GET_SPAWN_DATA] or std::ptr::null();
155
156 /// `bool IVehicle::isStreamedInForPlayer(const IPlayer &)`.
157 ///
158 /// # Safety
159 /// `vehicle` must be a live `IVehicle`.
160 #[must_use]
161 pub fn vehicle_is_streamed_in_for_player(
162 vehicle: IVehicle,
163 player: *mut IPlayer,
164 ) -> bool = [0, SLOT_IS_STREAMED_IN_FOR_PLAYER] or false;
165
166 /// `void IVehicle::streamInForPlayer(IPlayer &)`.
167 ///
168 /// # Safety
169 /// `vehicle` must be a live `IVehicle`.
170 pub fn vehicle_stream_in_for_player(
171 vehicle: IVehicle,
172 player: *mut IPlayer,
173 ) = [0, SLOT_STREAM_IN_FOR_PLAYER];
174
175 /// `void IVehicle::streamOutForPlayer(IPlayer &)`.
176 ///
177 /// # Safety
178 /// `vehicle` must be a live `IVehicle`.
179 pub fn vehicle_stream_out_for_player(
180 vehicle: IVehicle,
181 player: *mut IPlayer,
182 ) = [0, SLOT_STREAM_OUT_FOR_PLAYER];
183
184 /// `bool IVehicle::updateFromDriverSync(const VehicleDriverSyncPacket &, IPlayer &)`.
185 ///
186 /// # Safety
187 /// `vehicle` must be a live `IVehicle`.
188 #[must_use]
189 pub fn vehicle_update_from_driver_sync(
190 vehicle: IVehicle,
191 vehicle_sync: &VehicleDriverSyncPacket,
192 player: *mut IPlayer,
193 ) -> bool = [0, SLOT_UPDATE_FROM_DRIVER_SYNC] or false;
194
195 /// `bool IVehicle::updateFromPassengerSync(const VehiclePassengerSyncPacket &, IPlayer &)`.
196 ///
197 /// # Safety
198 /// `vehicle` must be a live `IVehicle`.
199 #[must_use]
200 pub fn vehicle_update_from_passenger_sync(
201 vehicle: IVehicle,
202 passenger_sync: &VehiclePassengerSyncPacket,
203 player: *mut IPlayer,
204 ) -> bool = [0, SLOT_UPDATE_FROM_PASSENGER_SYNC] or false;
205
206 /// `bool IVehicle::updateFromUnoccupied(const VehicleUnoccupiedSyncPacket &, IPlayer &)`.
207 ///
208 /// # Safety
209 /// `vehicle` must be a live `IVehicle`.
210 #[must_use]
211 pub fn vehicle_update_from_unoccupied(
212 vehicle: IVehicle,
213 unoccupied_sync: &VehicleUnoccupiedSyncPacket,
214 player: *mut IPlayer,
215 ) -> bool = [0, SLOT_UPDATE_FROM_UNOCCUPIED] or false;
216
217 /// `bool IVehicle::updateFromTrailerSync(const VehicleTrailerSyncPacket &, IPlayer &)`.
218 ///
219 /// # Safety
220 /// `vehicle` must be a live `IVehicle`.
221 #[must_use]
222 pub fn vehicle_update_from_trailer_sync(
223 vehicle: IVehicle,
224 unoccupied_sync: &VehicleTrailerSyncPacket,
225 player: *mut IPlayer,
226 ) -> bool = [0, SLOT_UPDATE_FROM_TRAILER_SYNC] or false;
227
228 /// `const FlatPtrHashSet<IPlayer> & IVehicle::streamedForPlayers()`.
229 ///
230 /// # Safety
231 /// `vehicle` must be a live `IVehicle`.
232 #[must_use]
233 pub fn vehicle_streamed_for_players(
234 vehicle: IVehicle,
235 ) -> *const FlatSet<IPlayer> = [0, SLOT_STREAMED_FOR_PLAYERS] or std::ptr::null();
236
237 /// `IPlayer * IVehicle::getDriver()`.
238 ///
239 /// # Safety
240 /// `vehicle` must be a live `IVehicle`.
241 #[must_use]
242 pub fn vehicle_driver(
243 vehicle: IVehicle,
244 ) -> *mut IPlayer = [0, SLOT_GET_DRIVER] or std::ptr::null_mut();
245
246 /// `const FlatHashSet<IPlayer *> & IVehicle::getPassengers()`.
247 ///
248 /// # Safety
249 /// `vehicle` must be a live `IVehicle`.
250 #[must_use]
251 pub fn vehicle_passengers(
252 vehicle: IVehicle,
253 ) -> *const FlatSet<IPlayer> = [0, SLOT_GET_PASSENGERS] or std::ptr::null();
254
255 /// `void IVehicle::setPlate(StringView)`.
256 ///
257 /// # Safety
258 /// `vehicle` must be a live `IVehicle`.
259 pub fn vehicle_set_plate(vehicle: IVehicle, plate: StringView) = [0, SLOT_SET_PLATE];
260
261 /// `void IVehicle::setDamageStatus(int, int, uint8_t, uint8_t, IPlayer *)`.
262 ///
263 /// # Safety
264 /// `vehicle` must be a live `IVehicle`.
265 pub fn vehicle_set_damage_status(
266 vehicle: IVehicle,
267 panel_status: i32,
268 door_status: i32,
269 light_status: u8,
270 tyre_status: u8,
271 vehicle_updater: *mut IPlayer,
272 ) = [0, SLOT_SET_DAMAGE_STATUS];
273
274 /// `void IVehicle::getDamageStatus(int &, int &, int &, int &)`.
275 ///
276 /// # Safety
277 /// `vehicle` must be a live `IVehicle`.
278 pub fn vehicle_damage_status(
279 vehicle: IVehicle,
280 panel_status: &mut i32,
281 door_status: &mut i32,
282 light_status: &mut i32,
283 tyre_status: &mut i32,
284 ) = [0, SLOT_GET_DAMAGE_STATUS];
285
286 /// `void IVehicle::setPaintJob(int)`.
287 ///
288 /// # Safety
289 /// `vehicle` must be a live `IVehicle`.
290 pub fn vehicle_set_paint_job(vehicle: IVehicle, paintjob: i32) = [0, SLOT_SET_PAINT_JOB];
291
292 /// `int IVehicle::getPaintJob()`.
293 ///
294 /// # Safety
295 /// `vehicle` must be a live `IVehicle`.
296 #[must_use]
297 pub fn vehicle_paint_job(vehicle: IVehicle) -> i32 = [0, SLOT_GET_PAINT_JOB] or 0;
298
299 /// `void IVehicle::addComponent(int)`.
300 ///
301 /// # Safety
302 /// `vehicle` must be a live `IVehicle`.
303 pub fn vehicle_add_component(vehicle: IVehicle, component: i32) = [0, SLOT_ADD_COMPONENT];
304
305 /// `int IVehicle::getComponentInSlot(int)`.
306 ///
307 /// # Safety
308 /// `vehicle` must be a live `IVehicle`.
309 #[must_use]
310 pub fn vehicle_component_in_slot(
311 vehicle: IVehicle,
312 slot: i32,
313 ) -> i32 = [0, SLOT_GET_COMPONENT_IN_SLOT] or 0;
314
315 /// `void IVehicle::removeComponent(int)`.
316 ///
317 /// # Safety
318 /// `vehicle` must be a live `IVehicle`.
319 pub fn vehicle_remove_component(vehicle: IVehicle, component: i32) = [0, SLOT_REMOVE_COMPONENT];
320
321 /// `void IVehicle::putPlayer(IPlayer &, int)`.
322 ///
323 /// # Safety
324 /// `vehicle` must be a live `IVehicle`.
325 pub fn vehicle_put_player(
326 vehicle: IVehicle,
327 player: *mut IPlayer,
328 seat_id: i32,
329 ) = [0, SLOT_PUT_PLAYER];
330
331 /// `void IVehicle::setZAngle(float)`.
332 ///
333 /// # Safety
334 /// `vehicle` must be a live `IVehicle`.
335 pub fn vehicle_set_z_angle(vehicle: IVehicle, angle: f32) = [0, SLOT_SET_Z_ANGLE];
336
337 /// `float IVehicle::getZAngle()`.
338 ///
339 /// # Safety
340 /// `vehicle` must be a live `IVehicle`.
341 #[must_use]
342 pub fn vehicle_z_angle(vehicle: IVehicle) -> f32 = [0, SLOT_GET_Z_ANGLE] or 0.0;
343
344 /// `void IVehicle::setParams(const VehicleParams &)`.
345 ///
346 /// # Safety
347 /// `vehicle` must be a live `IVehicle`.
348 pub fn vehicle_set_params(vehicle: IVehicle, params: &VehicleParams) = [0, SLOT_SET_PARAMS];
349
350 /// `void IVehicle::setParamsForPlayer(IPlayer &, const VehicleParams &)`.
351 ///
352 /// # Safety
353 /// `vehicle` must be a live `IVehicle`.
354 pub fn vehicle_set_params_for_player(
355 vehicle: IVehicle,
356 player: *mut IPlayer,
357 params: &VehicleParams,
358 ) = [0, SLOT_SET_PARAMS_FOR_PLAYER];
359
360 /// `const VehicleParams & IVehicle::getParams()`.
361 ///
362 /// # Safety
363 /// `vehicle` must be a live `IVehicle`.
364 #[must_use]
365 pub fn vehicle_params(
366 vehicle: IVehicle,
367 ) -> *const VehicleParams = [0, SLOT_GET_PARAMS] or std::ptr::null();
368
369 /// `bool IVehicle::isDead()`.
370 ///
371 /// # Safety
372 /// `vehicle` must be a live `IVehicle`.
373 #[must_use]
374 pub fn vehicle_is_dead(vehicle: IVehicle) -> bool = [0, SLOT_IS_DEAD] or false;
375
376 /// `void IVehicle::respawn()`.
377 ///
378 /// # Safety
379 /// `vehicle` must be a live `IVehicle`.
380 pub fn vehicle_respawn(vehicle: IVehicle) = [0, SLOT_RESPAWN];
381
382 /// `void IVehicle::setRespawnDelay(Seconds)`.
383 ///
384 /// # Safety
385 /// `vehicle` must be a live `IVehicle`.
386 pub fn vehicle_set_respawn_delay(
387 vehicle: IVehicle,
388 delay: Seconds,
389 ) = [0, SLOT_SET_RESPAWN_DELAY];
390
391 /// `bool IVehicle::isRespawning()`.
392 ///
393 /// # Safety
394 /// `vehicle` must be a live `IVehicle`.
395 #[must_use]
396 pub fn vehicle_is_respawning(vehicle: IVehicle) -> bool = [0, SLOT_IS_RESPAWNING] or false;
397
398 /// `void IVehicle::setInterior(int)`.
399 ///
400 /// # Safety
401 /// `vehicle` must be a live `IVehicle`.
402 pub fn vehicle_set_interior(vehicle: IVehicle, interior_id: i32) = [0, SLOT_SET_INTERIOR];
403
404 /// `int IVehicle::getInterior()`.
405 ///
406 /// # Safety
407 /// `vehicle` must be a live `IVehicle`.
408 #[must_use]
409 pub fn vehicle_interior(vehicle: IVehicle) -> i32 = [0, SLOT_GET_INTERIOR] or 0;
410
411 /// `void IVehicle::attachTrailer(IVehicle &)`.
412 ///
413 /// # Safety
414 /// `vehicle` must be a live `IVehicle`.
415 pub fn vehicle_attach_trailer(
416 vehicle: IVehicle,
417 trailer: *mut IVehicle,
418 ) = [0, SLOT_ATTACH_TRAILER];
419
420 /// `void IVehicle::detachTrailer()`.
421 ///
422 /// # Safety
423 /// `vehicle` must be a live `IVehicle`.
424 pub fn vehicle_detach_trailer(vehicle: IVehicle) = [0, SLOT_DETACH_TRAILER];
425
426 /// `bool IVehicle::isTrailer()`.
427 ///
428 /// # Safety
429 /// `vehicle` must be a live `IVehicle`.
430 #[must_use]
431 pub fn vehicle_is_trailer(vehicle: IVehicle) -> bool = [0, SLOT_IS_TRAILER] or false;
432
433 /// `IVehicle * IVehicle::getTrailer()`.
434 ///
435 /// # Safety
436 /// `vehicle` must be a live `IVehicle`.
437 #[must_use]
438 pub fn vehicle_trailer(
439 vehicle: IVehicle,
440 ) -> *mut IVehicle = [0, SLOT_GET_TRAILER] or std::ptr::null_mut();
441
442 /// `IVehicle * IVehicle::getCab()`.
443 ///
444 /// # Safety
445 /// `vehicle` must be a live `IVehicle`.
446 #[must_use]
447 pub fn vehicle_cab(
448 vehicle: IVehicle,
449 ) -> *mut IVehicle = [0, SLOT_GET_CAB] or std::ptr::null_mut();
450
451 /// `void IVehicle::repair()`.
452 ///
453 /// # Safety
454 /// `vehicle` must be a live `IVehicle`.
455 pub fn vehicle_repair(vehicle: IVehicle) = [0, SLOT_REPAIR];
456
457 /// `void IVehicle::addCarriage(IVehicle *, int)`.
458 ///
459 /// # Safety
460 /// `vehicle` must be a live `IVehicle`.
461 pub fn vehicle_add_carriage(
462 vehicle: IVehicle,
463 carriage: *mut IVehicle,
464 pos: i32,
465 ) = [0, SLOT_ADD_CARRIAGE];
466
467 /// `void IVehicle::updateCarriage(Vector3, Vector3)`.
468 ///
469 /// # Safety
470 /// `vehicle` must be a live `IVehicle`.
471 pub fn vehicle_update_carriage(
472 vehicle: IVehicle,
473 pos: Vector3,
474 veloc: Vector3,
475 ) = [0, SLOT_UPDATE_CARRIAGE];
476
477 /// `const StaticArray<IVehicle *, MAX_VEHICLE_CARRIAGES> & IVehicle::getCarriages()`.
478 ///
479 /// # Safety
480 /// `vehicle` must be a live `IVehicle`.
481 #[must_use]
482 pub fn vehicle_carriages(
483 vehicle: IVehicle,
484 ) -> *const [*mut IVehicle; 3] = [0, SLOT_GET_CARRIAGES] or std::ptr::null();
485
486 /// `void IVehicle::setVelocity(Vector3)`.
487 ///
488 /// # Safety
489 /// `vehicle` must be a live `IVehicle`.
490 pub fn vehicle_set_velocity(vehicle: IVehicle, velocity: Vector3) = [0, SLOT_SET_VELOCITY];
491
492 /// `Vector3 IVehicle::getVelocity()`.
493 ///
494 /// # Safety
495 /// `vehicle` must be a live `IVehicle`.
496 #[must_use]
497 pub fn vehicle_velocity(vehicle: IVehicle) -> Vector3 = [0, SLOT_GET_VELOCITY] or Vector3::ZERO;
498
499 /// `void IVehicle::setAngularVelocity(Vector3)`.
500 ///
501 /// # Safety
502 /// `vehicle` must be a live `IVehicle`.
503 pub fn vehicle_set_angular_velocity(
504 vehicle: IVehicle,
505 velocity: Vector3,
506 ) = [0, SLOT_SET_ANGULAR_VELOCITY];
507
508 /// `Vector3 IVehicle::getAngularVelocity()`.
509 ///
510 /// # Safety
511 /// `vehicle` must be a live `IVehicle`.
512 #[must_use]
513 pub fn vehicle_angular_velocity(
514 vehicle: IVehicle,
515 ) -> Vector3 = [0, SLOT_GET_ANGULAR_VELOCITY] or Vector3::ZERO;
516
517 /// `uint8_t IVehicle::getLandingGearState()`.
518 ///
519 /// # Safety
520 /// `vehicle` must be a live `IVehicle`.
521 #[must_use]
522 pub fn vehicle_landing_gear_state(
523 vehicle: IVehicle,
524 ) -> u8 = [0, SLOT_GET_LANDING_GEAR_STATE] or 0;
525
526 /// `bool IVehicle::hasBeenOccupied()`.
527 ///
528 /// # Safety
529 /// `vehicle` must be a live `IVehicle`.
530 #[must_use]
531 pub fn vehicle_has_been_occupied(
532 vehicle: IVehicle,
533 ) -> bool = [0, SLOT_HAS_BEEN_OCCUPIED] or false;
534
535 /// `const TimePoint & IVehicle::getLastOccupiedTime()`.
536 ///
537 /// # Safety
538 /// `vehicle` must be a live `IVehicle`.
539 #[must_use]
540 pub fn vehicle_last_occupied_time(
541 vehicle: IVehicle,
542 ) -> *const TimePoint = [0, SLOT_GET_LAST_OCCUPIED_TIME] or std::ptr::null();
543
544 /// `const TimePoint & IVehicle::getLastSpawnTime()`.
545 ///
546 /// # Safety
547 /// `vehicle` must be a live `IVehicle`.
548 #[must_use]
549 pub fn vehicle_last_spawn_time(
550 vehicle: IVehicle,
551 ) -> *const TimePoint = [0, SLOT_GET_LAST_SPAWN_TIME] or std::ptr::null();
552
553 /// `bool IVehicle::isOccupied()`.
554 ///
555 /// # Safety
556 /// `vehicle` must be a live `IVehicle`.
557 #[must_use]
558 pub fn vehicle_is_occupied(vehicle: IVehicle) -> bool = [0, SLOT_IS_OCCUPIED] or false;
559
560 /// `void IVehicle::setSiren(bool)`.
561 ///
562 /// # Safety
563 /// `vehicle` must be a live `IVehicle`.
564 pub fn vehicle_set_siren(vehicle: IVehicle, status: bool) = [0, SLOT_SET_SIREN];
565
566 /// `uint8_t IVehicle::getSirenState()`.
567 ///
568 /// # Safety
569 /// `vehicle` must be a live `IVehicle`.
570 #[must_use]
571 pub fn vehicle_siren_state(vehicle: IVehicle) -> u8 = [0, SLOT_GET_SIREN_STATE] or 0;
572
573 /// `uint32_t IVehicle::getHydraThrustAngle()`.
574 ///
575 /// # Safety
576 /// `vehicle` must be a live `IVehicle`.
577 #[must_use]
578 pub fn vehicle_hydra_thrust_angle(
579 vehicle: IVehicle,
580 ) -> u32 = [0, SLOT_GET_HYDRA_THRUST_ANGLE] or 0;
581
582 /// `float IVehicle::getTrainSpeed()`.
583 ///
584 /// # Safety
585 /// `vehicle` must be a live `IVehicle`.
586 #[must_use]
587 pub fn vehicle_train_speed(vehicle: IVehicle) -> f32 = [0, SLOT_GET_TRAIN_SPEED] or 0.0;
588
589 /// `int IVehicle::getLastDriverPoolID()`.
590 ///
591 /// # Safety
592 /// `vehicle` must be a live `IVehicle`.
593 #[must_use]
594 pub fn vehicle_last_driver_pool_id(
595 vehicle: IVehicle,
596 ) -> i32 = [0, SLOT_GET_LAST_DRIVER_POOL_ID] or 0;
597}
598
599/// `Pair<int, int> IVehicle::getColour()`.
600///
601/// # Safety
602/// `vehicle` must be a live `IVehicle`.
603#[must_use]
604pub unsafe fn vehicle_colour(vehicle: *mut IVehicle) -> Option<Pair<i32, i32>> {
605 call_vtable_small_struct!(vehicle.cast::<u8>(), 0, SLOT_GET_COLOUR, Pair<i32, i32>, unsafe { std::mem::zeroed::<Pair<i32, i32>>() })
606}
607
608/// `const StringView IVehicle::getPlate()`.
609///
610/// # Safety
611/// `vehicle` must be a live `IVehicle`.
612#[must_use]
613pub unsafe fn vehicle_plate(vehicle: *mut IVehicle) -> Option<String> {
614 let view = call_vtable_small_struct!(
615 vehicle.cast::<u8>(),
616 0,
617 SLOT_GET_PLATE,
618 StringView,
619 StringView::EMPTY
620 )?;
621 unsafe { view.to_owned_string() }
622}
623
624/// `Seconds IVehicle::getRespawnDelay()`.
625///
626/// # Safety
627/// `vehicle` must be a live `IVehicle`.
628#[must_use]
629pub unsafe fn vehicle_respawn_delay(vehicle: *mut IVehicle) -> Option<Seconds> {
630 call_vtable_small_struct!(
631 vehicle.cast::<u8>(),
632 0,
633 SLOT_GET_RESPAWN_DELAY,
634 Seconds,
635 Seconds::default()
636 )
637}
638
639// What the generator left out, and why.
640// skipped: `void IVehicle::setColour(int, int)` — `vehicle_set_colour` is written by hand
641// skipped: `void IVehicle::setHealth(float)` — `vehicle_set_health` is written by hand
642// skipped: `float IVehicle::getHealth()` — `vehicle_health` is written by hand
643// skipped: `int IVehicle::getModel()` — `vehicle_model` is written by hand