samp_sdk/omp/generated/player.rs
1//! `IPlayer` — generated by `cargo xtask gen-omp` from `player.hpp`.
2//! Implemented by `Player` in the server's `omp-server`.
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 IPlayer::ban(StringView)`
20 SLOT_BAN: usize = 7, 6;
21 /// `const PeerNetworkData & IPlayer::getNetworkData()`
22 SLOT_GET_NETWORK_DATA: usize = 9, 8;
23 /// `void IPlayer::broadcastRPCToStreamed(int, Span<uint8_t>, int, bool)`
24 SLOT_BROADCAST_RPC_TO_STREAMED: usize = 10, 9;
25 /// `void IPlayer::broadcastPacketToStreamed(Span<uint8_t>, int, bool)`
26 SLOT_BROADCAST_PACKET_TO_STREAMED: usize = 11, 10;
27 /// `void IPlayer::broadcastSyncPacket(Span<uint8_t>, int)`
28 SLOT_BROADCAST_SYNC_PACKET: usize = 12, 11;
29 /// `void IPlayer::spawn()`
30 SLOT_SPAWN: usize = 13, 12;
31 /// `ClientVersion IPlayer::getClientVersion()`
32 SLOT_GET_CLIENT_VERSION: usize = 14, 13;
33 /// `StringView IPlayer::getClientVersionName()`
34 SLOT_GET_CLIENT_VERSION_NAME: usize = 15, 14;
35 /// `void IPlayer::setPositionFindZ(Vector3)`
36 SLOT_SET_POSITION_FIND_Z: usize = 16, 15;
37 /// `void IPlayer::setCameraPosition(Vector3)`
38 SLOT_SET_CAMERA_POSITION: usize = 17, 16;
39 /// `Vector3 IPlayer::getCameraPosition()`
40 SLOT_GET_CAMERA_POSITION: usize = 18, 17;
41 /// `void IPlayer::setCameraLookAt(Vector3, int)`
42 SLOT_SET_CAMERA_LOOK_AT: usize = 19, 18;
43 /// `Vector3 IPlayer::getCameraLookAt()`
44 SLOT_GET_CAMERA_LOOK_AT: usize = 20, 19;
45 /// `void IPlayer::setCameraBehind()`
46 SLOT_SET_CAMERA_BEHIND: usize = 21, 20;
47 /// `void IPlayer::interpolateCameraPosition(Vector3, Vector3, int, PlayerCameraCutType)`
48 SLOT_INTERPOLATE_CAMERA_POSITION: usize = 22, 21;
49 /// `void IPlayer::interpolateCameraLookAt(Vector3, Vector3, int, PlayerCameraCutType)`
50 SLOT_INTERPOLATE_CAMERA_LOOK_AT: usize = 23, 22;
51 /// `void IPlayer::attachCameraToObject(IObject &)`
52 SLOT_ATTACH_CAMERA_TO_OBJECT: usize = 24, 24;
53 /// `void IPlayer::attachCameraToObject(IPlayerObject &)`
54 SLOT_ATTACH_CAMERA_TO_PLAYER_OBJECT: usize = 25, 23;
55 /// `EPlayerNameStatus IPlayer::setName(StringView)`
56 SLOT_SET_NAME: usize = 26, 25;
57 /// `StringView IPlayer::getSerial()`
58 SLOT_GET_SERIAL: usize = 28, 27;
59 /// `void IPlayer::giveWeapon(WeaponSlotData)`
60 SLOT_GIVE_WEAPON: usize = 29, 28;
61 /// `void IPlayer::removeWeapon(uint8_t)`
62 SLOT_REMOVE_WEAPON: usize = 30, 29;
63 /// `void IPlayer::setWeaponAmmo(WeaponSlotData)`
64 SLOT_SET_WEAPON_AMMO: usize = 31, 30;
65 /// `const WeaponSlots & IPlayer::getWeapons()`
66 SLOT_GET_WEAPONS: usize = 32, 31;
67 /// `WeaponSlotData IPlayer::getWeaponSlot(int)`
68 SLOT_GET_WEAPON_SLOT: usize = 33, 32;
69 /// `void IPlayer::resetWeapons()`
70 SLOT_RESET_WEAPONS: usize = 34, 33;
71 /// `void IPlayer::setArmedWeapon(uint32_t)`
72 SLOT_SET_ARMED_WEAPON: usize = 35, 34;
73 /// `uint32_t IPlayer::getArmedWeapon()`
74 SLOT_GET_ARMED_WEAPON: usize = 36, 35;
75 /// `uint32_t IPlayer::getArmedWeaponAmmo()`
76 SLOT_GET_ARMED_WEAPON_AMMO: usize = 37, 36;
77 /// `void IPlayer::setShopName(StringView)`
78 SLOT_SET_SHOP_NAME: usize = 38, 37;
79 /// `StringView IPlayer::getShopName()`
80 SLOT_GET_SHOP_NAME: usize = 39, 38;
81 /// `int IPlayer::getDrunkLevel()`
82 SLOT_GET_DRUNK_LEVEL: usize = 41, 40;
83 /// `void IPlayer::setColour(Colour)`
84 SLOT_SET_COLOUR: usize = 42, 41;
85 /// `const Colour & IPlayer::getColour()`
86 SLOT_GET_COLOUR: usize = 43, 42;
87 /// `void IPlayer::setOtherColour(IPlayer &, Colour)`
88 SLOT_SET_OTHER_COLOUR: usize = 44, 43;
89 /// `bool IPlayer::getOtherColour(IPlayer &, Colour &)`
90 SLOT_GET_OTHER_COLOUR: usize = 45, 44;
91 /// `bool IPlayer::getControllable()`
92 SLOT_GET_CONTROLLABLE: usize = 47, 46;
93 /// `void IPlayer::setSpectating(bool)`
94 SLOT_SET_SPECTATING: usize = 48, 47;
95 /// `void IPlayer::playSound(uint32_t, Vector3)`
96 SLOT_PLAY_SOUND: usize = 51, 50;
97 /// `uint32_t IPlayer::lastPlayedSound()`
98 SLOT_LAST_PLAYED_SOUND: usize = 52, 51;
99 /// `void IPlayer::playAudio(StringView, bool, Vector3, float)`
100 SLOT_PLAY_AUDIO: usize = 53, 52;
101 /// `bool IPlayer::playerCrimeReport(IPlayer &, int)`
102 SLOT_PLAYER_CRIME_REPORT: usize = 54, 53;
103 /// `void IPlayer::stopAudio()`
104 SLOT_STOP_AUDIO: usize = 55, 54;
105 /// `StringView IPlayer::lastPlayedAudio()`
106 SLOT_LAST_PLAYED_AUDIO: usize = 56, 55;
107 /// `void IPlayer::createExplosion(Vector3, int, float)`
108 SLOT_CREATE_EXPLOSION: usize = 57, 56;
109 /// `void IPlayer::sendDeathMessage(IPlayer &, IPlayer *, int)`
110 SLOT_SEND_DEATH_MESSAGE: usize = 58, 57;
111 /// `void IPlayer::sendEmptyDeathMessage()`
112 SLOT_SEND_EMPTY_DEATH_MESSAGE: usize = 59, 58;
113 /// `void IPlayer::removeDefaultObjects(unsigned int, Vector3, float)`
114 SLOT_REMOVE_DEFAULT_OBJECTS: usize = 60, 59;
115 /// `void IPlayer::forceClassSelection()`
116 SLOT_FORCE_CLASS_SELECTION: usize = 61, 60;
117 /// `void IPlayer::resetMoney()`
118 SLOT_RESET_MONEY: usize = 64, 63;
119 /// `void IPlayer::setMapIcon(int, Vector3, int, Colour, MapIconStyle)`
120 SLOT_SET_MAP_ICON: usize = 66, 65;
121 /// `void IPlayer::unsetMapIcon(int)`
122 SLOT_UNSET_MAP_ICON: usize = 67, 66;
123 /// `void IPlayer::useStuntBonuses(bool)`
124 SLOT_USE_STUNT_BONUSES: usize = 68, 67;
125 /// `void IPlayer::toggleOtherNameTag(IPlayer &, bool)`
126 SLOT_TOGGLE_OTHER_NAME_TAG: usize = 69, 68;
127 /// `void IPlayer::setTime(Hours, Minutes)`
128 SLOT_SET_TIME: usize = 70, 69;
129 /// `Pair<Hours, Minutes> IPlayer::getTime()`
130 SLOT_GET_TIME: usize = 71, 70;
131 /// `void IPlayer::useClock(bool)`
132 SLOT_USE_CLOCK: usize = 72, 71;
133 /// `bool IPlayer::hasClock()`
134 SLOT_HAS_CLOCK: usize = 73, 72;
135 /// `void IPlayer::useWidescreen(bool)`
136 SLOT_USE_WIDESCREEN: usize = 74, 73;
137 /// `bool IPlayer::hasWidescreen()`
138 SLOT_HAS_WIDESCREEN: usize = 75, 74;
139 /// `void IPlayer::setTransform(GTAQuat)`
140 SLOT_SET_TRANSFORM: usize = 76, 75;
141 /// `void IPlayer::setGravity(float)`
142 SLOT_SET_GRAVITY: usize = 83, 82;
143 /// `float IPlayer::getGravity()`
144 SLOT_GET_GRAVITY: usize = 84, 83;
145 /// `void IPlayer::setWorldTime(Hours)`
146 SLOT_SET_WORLD_TIME: usize = 85, 84;
147 /// `void IPlayer::applyAnimation(const AnimationData &, PlayerAnimationSyncType)`
148 SLOT_APPLY_ANIMATION: usize = 86, 85;
149 /// `void IPlayer::clearAnimations(PlayerAnimationSyncType)`
150 SLOT_CLEAR_ANIMATIONS: usize = 87, 86;
151 /// `PlayerAnimationData IPlayer::getAnimationData()`
152 SLOT_GET_ANIMATION_DATA: usize = 88, 87;
153 /// `PlayerSurfingData IPlayer::getSurfingData()`
154 SLOT_GET_SURFING_DATA: usize = 89, 88;
155 /// `void IPlayer::streamInForPlayer(IPlayer &)`
156 SLOT_STREAM_IN_FOR_PLAYER: usize = 90, 89;
157 /// `bool IPlayer::isStreamedInForPlayer(const IPlayer &)`
158 SLOT_IS_STREAMED_IN_FOR_PLAYER: usize = 91, 90;
159 /// `void IPlayer::streamOutForPlayer(IPlayer &)`
160 SLOT_STREAM_OUT_FOR_PLAYER: usize = 92, 91;
161 /// `const FlatPtrHashSet<IPlayer> & IPlayer::streamedForPlayers()`
162 SLOT_STREAMED_FOR_PLAYERS: usize = 93, 92;
163 /// `PlayerState IPlayer::getState()`
164 SLOT_GET_STATE: usize = 94, 93;
165 /// `void IPlayer::setChatBubble(StringView, const Colour &, float, Milliseconds)`
166 SLOT_SET_CHAT_BUBBLE: usize = 99, 98;
167 /// `void IPlayer::sendClientMessage(const Colour &, StringView)`
168 SLOT_SEND_CLIENT_MESSAGE: usize = 100, 99;
169 /// `void IPlayer::sendChatMessage(IPlayer &, StringView)`
170 SLOT_SEND_CHAT_MESSAGE: usize = 101, 100;
171 /// `void IPlayer::sendCommand(StringView)`
172 SLOT_SEND_COMMAND: usize = 102, 101;
173 /// `void IPlayer::sendGameText(StringView, Milliseconds, int)`
174 SLOT_SEND_GAME_TEXT: usize = 103, 102;
175 /// `void IPlayer::hideGameText(int)`
176 SLOT_HIDE_GAME_TEXT: usize = 104, 103;
177 /// `bool IPlayer::hasGameText(int)`
178 SLOT_HAS_GAME_TEXT: usize = 105, 104;
179 /// `bool IPlayer::getGameText(int, StringView &, Milliseconds &, Milliseconds &)`
180 SLOT_GET_GAME_TEXT: usize = 106, 105;
181 /// `int IPlayer::getWeather()`
182 SLOT_GET_WEATHER: usize = 108, 107;
183 /// `void IPlayer::setWorldBounds(Vector4)`
184 SLOT_SET_WORLD_BOUNDS: usize = 109, 108;
185 /// `Vector4 IPlayer::getWorldBounds()`
186 SLOT_GET_WORLD_BOUNDS: usize = 110, 109;
187 /// `void IPlayer::setFightingStyle(PlayerFightingStyle)`
188 SLOT_SET_FIGHTING_STYLE: usize = 111, 110;
189 /// `PlayerFightingStyle IPlayer::getFightingStyle()`
190 SLOT_GET_FIGHTING_STYLE: usize = 112, 111;
191 /// `void IPlayer::setSkillLevel(PlayerWeaponSkill, int)`
192 SLOT_SET_SKILL_LEVEL: usize = 113, 112;
193 /// `void IPlayer::setAction(PlayerSpecialAction)`
194 SLOT_SET_ACTION: usize = 114, 113;
195 /// `PlayerSpecialAction IPlayer::getAction()`
196 SLOT_GET_ACTION: usize = 115, 114;
197 /// `void IPlayer::setVelocity(Vector3)`
198 SLOT_SET_VELOCITY: usize = 116, 115;
199 /// `Vector3 IPlayer::getVelocity()`
200 SLOT_GET_VELOCITY: usize = 117, 116;
201 /// `const PlayerKeyData & IPlayer::getKeyData()`
202 SLOT_GET_KEY_DATA: usize = 120, 119;
203 /// `const StaticArray<uint16_t, NUM_SKILL_LEVELS> & IPlayer::getSkillLevels()`
204 SLOT_GET_SKILL_LEVELS: usize = 121, 120;
205 /// `const PlayerAimData & IPlayer::getAimData()`
206 SLOT_GET_AIM_DATA: usize = 122, 121;
207 /// `const PlayerBulletData & IPlayer::getBulletData()`
208 SLOT_GET_BULLET_DATA: usize = 123, 122;
209 /// `void IPlayer::useCameraTargeting(bool)`
210 SLOT_USE_CAMERA_TARGETING: usize = 124, 123;
211 /// `bool IPlayer::hasCameraTargeting()`
212 SLOT_HAS_CAMERA_TARGETING: usize = 125, 124;
213 /// `void IPlayer::removeFromVehicle(bool)`
214 SLOT_REMOVE_FROM_VEHICLE: usize = 126, 125;
215 /// `IPlayer * IPlayer::getCameraTargetPlayer()`
216 SLOT_GET_CAMERA_TARGET_PLAYER: usize = 127, 126;
217 /// `IVehicle * IPlayer::getCameraTargetVehicle()`
218 SLOT_GET_CAMERA_TARGET_VEHICLE: usize = 128, 127;
219 /// `IObject * IPlayer::getCameraTargetObject()`
220 SLOT_GET_CAMERA_TARGET_OBJECT: usize = 129, 128;
221 /// `IActor * IPlayer::getCameraTargetActor()`
222 SLOT_GET_CAMERA_TARGET_ACTOR: usize = 130, 129;
223 /// `IPlayer * IPlayer::getTargetPlayer()`
224 SLOT_GET_TARGET_PLAYER: usize = 131, 130;
225 /// `IActor * IPlayer::getTargetActor()`
226 SLOT_GET_TARGET_ACTOR: usize = 132, 131;
227 /// `void IPlayer::setRemoteVehicleCollisions(bool)`
228 SLOT_SET_REMOTE_VEHICLE_COLLISIONS: usize = 133, 132;
229 /// `void IPlayer::spectatePlayer(IPlayer &, PlayerSpectateMode)`
230 SLOT_SPECTATE_PLAYER: usize = 134, 133;
231 /// `void IPlayer::spectateVehicle(IVehicle &, PlayerSpectateMode)`
232 SLOT_SPECTATE_VEHICLE: usize = 135, 134;
233 /// `const PlayerSpectateData & IPlayer::getSpectateData()`
234 SLOT_GET_SPECTATE_DATA: usize = 136, 135;
235 /// `void IPlayer::sendClientCheck(int, int, int, int)`
236 SLOT_SEND_CLIENT_CHECK: usize = 137, 136;
237 /// `void IPlayer::toggleGhostMode(bool)`
238 SLOT_TOGGLE_GHOST_MODE: usize = 138, 137;
239 /// `bool IPlayer::isGhostModeEnabled()`
240 SLOT_IS_GHOST_MODE_ENABLED: usize = 139, 138;
241 /// `int IPlayer::getDefaultObjectsRemoved()`
242 SLOT_GET_DEFAULT_OBJECTS_REMOVED: usize = 140, 139;
243 /// `bool IPlayer::getKickStatus()`
244 SLOT_GET_KICK_STATUS: usize = 141, 140;
245 /// `void IPlayer::clearTasks(PlayerAnimationSyncType)`
246 SLOT_CLEAR_TASKS: usize = 142, 141;
247 /// `void IPlayer::allowWeapons(bool)`
248 SLOT_ALLOW_WEAPONS: usize = 143, 142;
249 /// `bool IPlayer::areWeaponsAllowed()`
250 SLOT_ARE_WEAPONS_ALLOWED: usize = 144, 143;
251 /// `void IPlayer::allowTeleport(bool)`
252 SLOT_ALLOW_TELEPORT: usize = 145, 144;
253 /// `bool IPlayer::isTeleportAllowed()`
254 SLOT_IS_TELEPORT_ALLOWED: usize = 146, 145;
255 /// `bool IPlayer::isUsingOfficialClient()`
256 SLOT_IS_USING_OFFICIAL_CLIENT: usize = 147, 146;
257 /// `bool IPlayer::isUsingOmp()`
258 SLOT_IS_USING_OMP: usize = 148, 147;
259}
260
261virtual_fns! {
262 /// `void IPlayer::ban(StringView)`.
263 ///
264 /// # Safety
265 /// `player` must be a live `IPlayer`.
266 pub fn player_ban(player: IPlayer, reason: StringView) = [0, SLOT_BAN];
267
268 /// `const PeerNetworkData & IPlayer::getNetworkData()`.
269 ///
270 /// # Safety
271 /// `player` must be a live `IPlayer`.
272 #[must_use]
273 pub fn player_network_data(
274 player: IPlayer,
275 ) -> *const PeerNetworkData = [0, SLOT_GET_NETWORK_DATA] or std::ptr::null();
276
277 /// `void IPlayer::broadcastRPCToStreamed(int, Span<uint8_t>, int, bool)`.
278 ///
279 /// # Safety
280 /// `player` must be a live `IPlayer`.
281 pub fn player_broadcast_rpc_to_streamed(
282 player: IPlayer,
283 id: i32,
284 data: Span<u8>,
285 channel: i32,
286 skip_from: bool,
287 ) = [0, SLOT_BROADCAST_RPC_TO_STREAMED];
288
289 /// `void IPlayer::broadcastPacketToStreamed(Span<uint8_t>, int, bool)`.
290 ///
291 /// # Safety
292 /// `player` must be a live `IPlayer`.
293 pub fn player_broadcast_packet_to_streamed(
294 player: IPlayer,
295 data: Span<u8>,
296 channel: i32,
297 skip_from: bool,
298 ) = [0, SLOT_BROADCAST_PACKET_TO_STREAMED];
299
300 /// `void IPlayer::broadcastSyncPacket(Span<uint8_t>, int)`.
301 ///
302 /// # Safety
303 /// `player` must be a live `IPlayer`.
304 pub fn player_broadcast_sync_packet(
305 player: IPlayer,
306 data: Span<u8>,
307 channel: i32,
308 ) = [0, SLOT_BROADCAST_SYNC_PACKET];
309
310 /// `void IPlayer::spawn()`.
311 ///
312 /// # Safety
313 /// `player` must be a live `IPlayer`.
314 pub fn player_spawn(player: IPlayer) = [0, SLOT_SPAWN];
315
316 /// `ClientVersion IPlayer::getClientVersion()`.
317 ///
318 /// # Safety
319 /// `player` must be a live `IPlayer`.
320 #[must_use]
321 pub fn player_client_version(player: IPlayer) -> u8 = [0, SLOT_GET_CLIENT_VERSION] or 0;
322
323 /// `void IPlayer::setPositionFindZ(Vector3)`.
324 ///
325 /// # Safety
326 /// `player` must be a live `IPlayer`.
327 pub fn player_set_position_find_z(
328 player: IPlayer,
329 pos: Vector3,
330 ) = [0, SLOT_SET_POSITION_FIND_Z];
331
332 /// `void IPlayer::setCameraPosition(Vector3)`.
333 ///
334 /// # Safety
335 /// `player` must be a live `IPlayer`.
336 pub fn player_set_camera_position(
337 player: IPlayer,
338 pos: Vector3,
339 ) = [0, SLOT_SET_CAMERA_POSITION];
340
341 /// `Vector3 IPlayer::getCameraPosition()`.
342 ///
343 /// # Safety
344 /// `player` must be a live `IPlayer`.
345 #[must_use]
346 pub fn player_camera_position(
347 player: IPlayer,
348 ) -> Vector3 = [0, SLOT_GET_CAMERA_POSITION] or Vector3::ZERO;
349
350 /// `void IPlayer::setCameraLookAt(Vector3, int)`.
351 ///
352 /// # Safety
353 /// `player` must be a live `IPlayer`.
354 pub fn player_set_camera_look_at(
355 player: IPlayer,
356 pos: Vector3,
357 cut_type: i32,
358 ) = [0, SLOT_SET_CAMERA_LOOK_AT];
359
360 /// `Vector3 IPlayer::getCameraLookAt()`.
361 ///
362 /// # Safety
363 /// `player` must be a live `IPlayer`.
364 #[must_use]
365 pub fn player_camera_look_at(
366 player: IPlayer,
367 ) -> Vector3 = [0, SLOT_GET_CAMERA_LOOK_AT] or Vector3::ZERO;
368
369 /// `void IPlayer::setCameraBehind()`.
370 ///
371 /// # Safety
372 /// `player` must be a live `IPlayer`.
373 pub fn player_set_camera_behind(player: IPlayer) = [0, SLOT_SET_CAMERA_BEHIND];
374
375 /// `void IPlayer::interpolateCameraPosition(Vector3, Vector3, int, PlayerCameraCutType)`.
376 ///
377 /// # Safety
378 /// `player` must be a live `IPlayer`.
379 pub fn player_interpolate_camera_position(
380 player: IPlayer,
381 from: Vector3,
382 to: Vector3,
383 time: i32,
384 cut_type: i32,
385 ) = [0, SLOT_INTERPOLATE_CAMERA_POSITION];
386
387 /// `void IPlayer::interpolateCameraLookAt(Vector3, Vector3, int, PlayerCameraCutType)`.
388 ///
389 /// # Safety
390 /// `player` must be a live `IPlayer`.
391 pub fn player_interpolate_camera_look_at(
392 player: IPlayer,
393 from: Vector3,
394 to: Vector3,
395 time: i32,
396 cut_type: i32,
397 ) = [0, SLOT_INTERPOLATE_CAMERA_LOOK_AT];
398
399 /// `void IPlayer::attachCameraToObject(IObject &)`.
400 ///
401 /// # Safety
402 /// `player` must be a live `IPlayer`.
403 pub fn player_attach_camera_to_object(
404 player: IPlayer,
405 object: *mut IObject,
406 ) = [0, SLOT_ATTACH_CAMERA_TO_OBJECT];
407
408 /// `void IPlayer::attachCameraToObject(IPlayerObject &)`.
409 ///
410 /// # Safety
411 /// `player` must be a live `IPlayer`.
412 pub fn player_attach_camera_to_player_object(
413 player: IPlayer,
414 object: *mut IPlayerObject,
415 ) = [0, SLOT_ATTACH_CAMERA_TO_PLAYER_OBJECT];
416
417 /// `EPlayerNameStatus IPlayer::setName(StringView)`.
418 ///
419 /// # Safety
420 /// `player` must be a live `IPlayer`.
421 #[must_use]
422 pub fn player_set_name(player: IPlayer, name: StringView) -> i32 = [0, SLOT_SET_NAME] or 0;
423
424 /// `void IPlayer::giveWeapon(WeaponSlotData)`.
425 ///
426 /// # Safety
427 /// `player` must be a live `IPlayer`.
428 pub fn player_give_weapon(player: IPlayer, weapon: WeaponSlotData) = [0, SLOT_GIVE_WEAPON];
429
430 /// `void IPlayer::removeWeapon(uint8_t)`.
431 ///
432 /// # Safety
433 /// `player` must be a live `IPlayer`.
434 pub fn player_remove_weapon(player: IPlayer, weapon: u8) = [0, SLOT_REMOVE_WEAPON];
435
436 /// `void IPlayer::setWeaponAmmo(WeaponSlotData)`.
437 ///
438 /// # Safety
439 /// `player` must be a live `IPlayer`.
440 pub fn player_set_weapon_ammo(
441 player: IPlayer,
442 data: WeaponSlotData,
443 ) = [0, SLOT_SET_WEAPON_AMMO];
444
445 /// `const WeaponSlots & IPlayer::getWeapons()`.
446 ///
447 /// # Safety
448 /// `player` must be a live `IPlayer`.
449 #[must_use]
450 pub fn player_weapons(
451 player: IPlayer,
452 ) -> *const [WeaponSlotData; 13] = [0, SLOT_GET_WEAPONS] or std::ptr::null();
453
454 /// `void IPlayer::resetWeapons()`.
455 ///
456 /// # Safety
457 /// `player` must be a live `IPlayer`.
458 pub fn player_reset_weapons(player: IPlayer) = [0, SLOT_RESET_WEAPONS];
459
460 /// `void IPlayer::setArmedWeapon(uint32_t)`.
461 ///
462 /// # Safety
463 /// `player` must be a live `IPlayer`.
464 pub fn player_set_armed_weapon(player: IPlayer, weapon: u32) = [0, SLOT_SET_ARMED_WEAPON];
465
466 /// `uint32_t IPlayer::getArmedWeapon()`.
467 ///
468 /// # Safety
469 /// `player` must be a live `IPlayer`.
470 #[must_use]
471 pub fn player_armed_weapon(player: IPlayer) -> u32 = [0, SLOT_GET_ARMED_WEAPON] or 0;
472
473 /// `uint32_t IPlayer::getArmedWeaponAmmo()`.
474 ///
475 /// # Safety
476 /// `player` must be a live `IPlayer`.
477 #[must_use]
478 pub fn player_armed_weapon_ammo(player: IPlayer) -> u32 = [0, SLOT_GET_ARMED_WEAPON_AMMO] or 0;
479
480 /// `void IPlayer::setShopName(StringView)`.
481 ///
482 /// # Safety
483 /// `player` must be a live `IPlayer`.
484 pub fn player_set_shop_name(player: IPlayer, name: StringView) = [0, SLOT_SET_SHOP_NAME];
485
486 /// `int IPlayer::getDrunkLevel()`.
487 ///
488 /// # Safety
489 /// `player` must be a live `IPlayer`.
490 #[must_use]
491 pub fn player_drunk_level(player: IPlayer) -> i32 = [0, SLOT_GET_DRUNK_LEVEL] or 0;
492
493 /// `void IPlayer::setColour(Colour)`.
494 ///
495 /// # Safety
496 /// `player` must be a live `IPlayer`.
497 pub fn player_set_colour(player: IPlayer, colour: Colour) = [0, SLOT_SET_COLOUR];
498
499 /// `const Colour & IPlayer::getColour()`.
500 ///
501 /// # Safety
502 /// `player` must be a live `IPlayer`.
503 #[must_use]
504 pub fn player_colour(
505 player: IPlayer,
506 ) -> *const Colour = [0, SLOT_GET_COLOUR] or std::ptr::null();
507
508 /// `void IPlayer::setOtherColour(IPlayer &, Colour)`.
509 ///
510 /// # Safety
511 /// `player` must be a live `IPlayer`.
512 pub fn player_set_other_colour(
513 player: IPlayer,
514 other: *mut IPlayer,
515 colour: Colour,
516 ) = [0, SLOT_SET_OTHER_COLOUR];
517
518 /// `bool IPlayer::getOtherColour(IPlayer &, Colour &)`.
519 ///
520 /// # Safety
521 /// `player` must be a live `IPlayer`.
522 #[must_use]
523 pub fn player_other_colour(
524 player: IPlayer,
525 other: *mut IPlayer,
526 colour: &mut Colour,
527 ) -> bool = [0, SLOT_GET_OTHER_COLOUR] or false;
528
529 /// `bool IPlayer::getControllable()`.
530 ///
531 /// # Safety
532 /// `player` must be a live `IPlayer`.
533 #[must_use]
534 pub fn player_controllable(player: IPlayer) -> bool = [0, SLOT_GET_CONTROLLABLE] or false;
535
536 /// `void IPlayer::setSpectating(bool)`.
537 ///
538 /// # Safety
539 /// `player` must be a live `IPlayer`.
540 pub fn player_set_spectating(player: IPlayer, spectating: bool) = [0, SLOT_SET_SPECTATING];
541
542 /// `void IPlayer::playSound(uint32_t, Vector3)`.
543 ///
544 /// # Safety
545 /// `player` must be a live `IPlayer`.
546 pub fn player_play_sound(player: IPlayer, sound: u32, pos: Vector3) = [0, SLOT_PLAY_SOUND];
547
548 /// `uint32_t IPlayer::lastPlayedSound()`.
549 ///
550 /// # Safety
551 /// `player` must be a live `IPlayer`.
552 #[must_use]
553 pub fn player_last_played_sound(player: IPlayer) -> u32 = [0, SLOT_LAST_PLAYED_SOUND] or 0;
554
555 /// `void IPlayer::playAudio(StringView, bool, Vector3, float)`.
556 ///
557 /// # Safety
558 /// `player` must be a live `IPlayer`.
559 pub fn player_play_audio(
560 player: IPlayer,
561 url: StringView,
562 use_pos: bool,
563 pos: Vector3,
564 distance: f32,
565 ) = [0, SLOT_PLAY_AUDIO];
566
567 /// `bool IPlayer::playerCrimeReport(IPlayer &, int)`.
568 ///
569 /// # Safety
570 /// `player` must be a live `IPlayer`.
571 #[must_use]
572 pub fn player_player_crime_report(
573 player: IPlayer,
574 suspect: *mut IPlayer,
575 crime: i32,
576 ) -> bool = [0, SLOT_PLAYER_CRIME_REPORT] or false;
577
578 /// `void IPlayer::stopAudio()`.
579 ///
580 /// # Safety
581 /// `player` must be a live `IPlayer`.
582 pub fn player_stop_audio(player: IPlayer) = [0, SLOT_STOP_AUDIO];
583
584 /// `void IPlayer::createExplosion(Vector3, int, float)`.
585 ///
586 /// # Safety
587 /// `player` must be a live `IPlayer`.
588 pub fn player_create_explosion(
589 player: IPlayer,
590 vec: Vector3,
591 type_value: i32,
592 radius: f32,
593 ) = [0, SLOT_CREATE_EXPLOSION];
594
595 /// `void IPlayer::sendDeathMessage(IPlayer &, IPlayer *, int)`.
596 ///
597 /// # Safety
598 /// `player` must be a live `IPlayer`.
599 pub fn player_send_death_message(
600 player: IPlayer,
601 other_player: *mut IPlayer,
602 killer: *mut IPlayer,
603 weapon: i32,
604 ) = [0, SLOT_SEND_DEATH_MESSAGE];
605
606 /// `void IPlayer::sendEmptyDeathMessage()`.
607 ///
608 /// # Safety
609 /// `player` must be a live `IPlayer`.
610 pub fn player_send_empty_death_message(player: IPlayer) = [0, SLOT_SEND_EMPTY_DEATH_MESSAGE];
611
612 /// `void IPlayer::removeDefaultObjects(unsigned int, Vector3, float)`.
613 ///
614 /// # Safety
615 /// `player` must be a live `IPlayer`.
616 pub fn player_remove_default_objects(
617 player: IPlayer,
618 model: u32,
619 pos: Vector3,
620 radius: f32,
621 ) = [0, SLOT_REMOVE_DEFAULT_OBJECTS];
622
623 /// `void IPlayer::forceClassSelection()`.
624 ///
625 /// # Safety
626 /// `player` must be a live `IPlayer`.
627 pub fn player_force_class_selection(player: IPlayer) = [0, SLOT_FORCE_CLASS_SELECTION];
628
629 /// `void IPlayer::resetMoney()`.
630 ///
631 /// # Safety
632 /// `player` must be a live `IPlayer`.
633 pub fn player_reset_money(player: IPlayer) = [0, SLOT_RESET_MONEY];
634
635 /// `void IPlayer::setMapIcon(int, Vector3, int, Colour, MapIconStyle)`.
636 ///
637 /// # Safety
638 /// `player` must be a live `IPlayer`.
639 pub fn player_set_map_icon(
640 player: IPlayer,
641 id: i32,
642 pos: Vector3,
643 type_value: i32,
644 colour: Colour,
645 style: i32,
646 ) = [0, SLOT_SET_MAP_ICON];
647
648 /// `void IPlayer::unsetMapIcon(int)`.
649 ///
650 /// # Safety
651 /// `player` must be a live `IPlayer`.
652 pub fn player_unset_map_icon(player: IPlayer, id: i32) = [0, SLOT_UNSET_MAP_ICON];
653
654 /// `void IPlayer::useStuntBonuses(bool)`.
655 ///
656 /// # Safety
657 /// `player` must be a live `IPlayer`.
658 pub fn player_use_stunt_bonuses(player: IPlayer, enable: bool) = [0, SLOT_USE_STUNT_BONUSES];
659
660 /// `void IPlayer::toggleOtherNameTag(IPlayer &, bool)`.
661 ///
662 /// # Safety
663 /// `player` must be a live `IPlayer`.
664 pub fn player_toggle_other_name_tag(
665 player: IPlayer,
666 other: *mut IPlayer,
667 toggle: bool,
668 ) = [0, SLOT_TOGGLE_OTHER_NAME_TAG];
669
670 /// `void IPlayer::setTime(Hours, Minutes)`.
671 ///
672 /// # Safety
673 /// `player` must be a live `IPlayer`.
674 pub fn player_set_time(player: IPlayer, hr: Hours, min: Minutes) = [0, SLOT_SET_TIME];
675
676 /// `void IPlayer::useClock(bool)`.
677 ///
678 /// # Safety
679 /// `player` must be a live `IPlayer`.
680 pub fn player_use_clock(player: IPlayer, enable: bool) = [0, SLOT_USE_CLOCK];
681
682 /// `bool IPlayer::hasClock()`.
683 ///
684 /// # Safety
685 /// `player` must be a live `IPlayer`.
686 #[must_use]
687 pub fn player_has_clock(player: IPlayer) -> bool = [0, SLOT_HAS_CLOCK] or false;
688
689 /// `void IPlayer::useWidescreen(bool)`.
690 ///
691 /// # Safety
692 /// `player` must be a live `IPlayer`.
693 pub fn player_use_widescreen(player: IPlayer, enable: bool) = [0, SLOT_USE_WIDESCREEN];
694
695 /// `bool IPlayer::hasWidescreen()`.
696 ///
697 /// # Safety
698 /// `player` must be a live `IPlayer`.
699 #[must_use]
700 pub fn player_has_widescreen(player: IPlayer) -> bool = [0, SLOT_HAS_WIDESCREEN] or false;
701
702 /// `void IPlayer::setTransform(GTAQuat)`.
703 ///
704 /// # Safety
705 /// `player` must be a live `IPlayer`.
706 pub fn player_set_transform(player: IPlayer, tm: GTAQuat) = [0, SLOT_SET_TRANSFORM];
707
708 /// `void IPlayer::setGravity(float)`.
709 ///
710 /// # Safety
711 /// `player` must be a live `IPlayer`.
712 pub fn player_set_gravity(player: IPlayer, gravity: f32) = [0, SLOT_SET_GRAVITY];
713
714 /// `float IPlayer::getGravity()`.
715 ///
716 /// # Safety
717 /// `player` must be a live `IPlayer`.
718 #[must_use]
719 pub fn player_gravity(player: IPlayer) -> f32 = [0, SLOT_GET_GRAVITY] or 0.0;
720
721 /// `void IPlayer::setWorldTime(Hours)`.
722 ///
723 /// # Safety
724 /// `player` must be a live `IPlayer`.
725 pub fn player_set_world_time(player: IPlayer, time: Hours) = [0, SLOT_SET_WORLD_TIME];
726
727 /// `void IPlayer::applyAnimation(const AnimationData &, PlayerAnimationSyncType)`.
728 ///
729 /// # Safety
730 /// `player` must be a live `IPlayer`.
731 pub fn player_apply_animation(
732 player: IPlayer,
733 animation: &AnimationData,
734 sync_type: i32,
735 ) = [0, SLOT_APPLY_ANIMATION];
736
737 /// `void IPlayer::clearAnimations(PlayerAnimationSyncType)`.
738 ///
739 /// # Safety
740 /// `player` must be a live `IPlayer`.
741 pub fn player_clear_animations(player: IPlayer, sync_type: i32) = [0, SLOT_CLEAR_ANIMATIONS];
742
743 /// `PlayerSurfingData IPlayer::getSurfingData()`.
744 ///
745 /// # Safety
746 /// `player` must be a live `IPlayer`.
747 #[must_use]
748 pub fn player_surfing_data(
749 player: IPlayer,
750 ) -> PlayerSurfingData = [0, SLOT_GET_SURFING_DATA] or PlayerSurfingData::default();
751
752 /// `void IPlayer::streamInForPlayer(IPlayer &)`.
753 ///
754 /// # Safety
755 /// `player` must be a live `IPlayer`.
756 pub fn player_stream_in_for_player(
757 player: IPlayer,
758 other: *mut IPlayer,
759 ) = [0, SLOT_STREAM_IN_FOR_PLAYER];
760
761 /// `bool IPlayer::isStreamedInForPlayer(const IPlayer &)`.
762 ///
763 /// # Safety
764 /// `player` must be a live `IPlayer`.
765 #[must_use]
766 pub fn player_is_streamed_in_for_player(
767 player: IPlayer,
768 other: *mut IPlayer,
769 ) -> bool = [0, SLOT_IS_STREAMED_IN_FOR_PLAYER] or false;
770
771 /// `void IPlayer::streamOutForPlayer(IPlayer &)`.
772 ///
773 /// # Safety
774 /// `player` must be a live `IPlayer`.
775 pub fn player_stream_out_for_player(
776 player: IPlayer,
777 other: *mut IPlayer,
778 ) = [0, SLOT_STREAM_OUT_FOR_PLAYER];
779
780 /// `const FlatPtrHashSet<IPlayer> & IPlayer::streamedForPlayers()`.
781 ///
782 /// # Safety
783 /// `player` must be a live `IPlayer`.
784 #[must_use]
785 pub fn player_streamed_for_players(
786 player: IPlayer,
787 ) -> *const FlatSet<IPlayer> = [0, SLOT_STREAMED_FOR_PLAYERS] or std::ptr::null();
788
789 /// `PlayerState IPlayer::getState()`.
790 ///
791 /// # Safety
792 /// `player` must be a live `IPlayer`.
793 #[must_use]
794 pub fn player_state(player: IPlayer) -> i32 = [0, SLOT_GET_STATE] or 0;
795
796 /// `void IPlayer::setChatBubble(StringView, const Colour &, float, Milliseconds)`.
797 ///
798 /// # Safety
799 /// `player` must be a live `IPlayer`.
800 pub fn player_set_chat_bubble(
801 player: IPlayer,
802 text: StringView,
803 colour: &Colour,
804 draw_dist: f32,
805 expire: Milliseconds,
806 ) = [0, SLOT_SET_CHAT_BUBBLE];
807
808 /// `void IPlayer::sendClientMessage(const Colour &, StringView)`.
809 ///
810 /// # Safety
811 /// `player` must be a live `IPlayer`.
812 pub fn player_send_client_message(
813 player: IPlayer,
814 colour: &Colour,
815 message: StringView,
816 ) = [0, SLOT_SEND_CLIENT_MESSAGE];
817
818 /// `void IPlayer::sendChatMessage(IPlayer &, StringView)`.
819 ///
820 /// # Safety
821 /// `player` must be a live `IPlayer`.
822 pub fn player_send_chat_message(
823 player: IPlayer,
824 sender: *mut IPlayer,
825 message: StringView,
826 ) = [0, SLOT_SEND_CHAT_MESSAGE];
827
828 /// `void IPlayer::sendCommand(StringView)`.
829 ///
830 /// # Safety
831 /// `player` must be a live `IPlayer`.
832 pub fn player_send_command(player: IPlayer, message: StringView) = [0, SLOT_SEND_COMMAND];
833
834 /// `void IPlayer::sendGameText(StringView, Milliseconds, int)`.
835 ///
836 /// # Safety
837 /// `player` must be a live `IPlayer`.
838 pub fn player_send_game_text(
839 player: IPlayer,
840 message: StringView,
841 time: Milliseconds,
842 style: i32,
843 ) = [0, SLOT_SEND_GAME_TEXT];
844
845 /// `void IPlayer::hideGameText(int)`.
846 ///
847 /// # Safety
848 /// `player` must be a live `IPlayer`.
849 pub fn player_hide_game_text(player: IPlayer, style: i32) = [0, SLOT_HIDE_GAME_TEXT];
850
851 /// `bool IPlayer::hasGameText(int)`.
852 ///
853 /// # Safety
854 /// `player` must be a live `IPlayer`.
855 #[must_use]
856 pub fn player_has_game_text(
857 player: IPlayer,
858 style: i32,
859 ) -> bool = [0, SLOT_HAS_GAME_TEXT] or false;
860
861 /// `bool IPlayer::getGameText(int, StringView &, Milliseconds &, Milliseconds &)`.
862 ///
863 /// # Safety
864 /// `player` must be a live `IPlayer`.
865 #[must_use]
866 pub fn player_game_text(
867 player: IPlayer,
868 style: i32,
869 message: &mut StringView,
870 time: &mut Milliseconds,
871 remaining: &mut Milliseconds,
872 ) -> bool = [0, SLOT_GET_GAME_TEXT] or false;
873
874 /// `int IPlayer::getWeather()`.
875 ///
876 /// # Safety
877 /// `player` must be a live `IPlayer`.
878 #[must_use]
879 pub fn player_weather(player: IPlayer) -> i32 = [0, SLOT_GET_WEATHER] or 0;
880
881 /// `void IPlayer::setWorldBounds(Vector4)`.
882 ///
883 /// # Safety
884 /// `player` must be a live `IPlayer`.
885 pub fn player_set_world_bounds(player: IPlayer, coords: Vector4) = [0, SLOT_SET_WORLD_BOUNDS];
886
887 /// `Vector4 IPlayer::getWorldBounds()`.
888 ///
889 /// # Safety
890 /// `player` must be a live `IPlayer`.
891 #[must_use]
892 pub fn player_world_bounds(
893 player: IPlayer,
894 ) -> Vector4 = [0, SLOT_GET_WORLD_BOUNDS] or Vector4::ZERO;
895
896 /// `void IPlayer::setFightingStyle(PlayerFightingStyle)`.
897 ///
898 /// # Safety
899 /// `player` must be a live `IPlayer`.
900 pub fn player_set_fighting_style(player: IPlayer, style: i32) = [0, SLOT_SET_FIGHTING_STYLE];
901
902 /// `PlayerFightingStyle IPlayer::getFightingStyle()`.
903 ///
904 /// # Safety
905 /// `player` must be a live `IPlayer`.
906 #[must_use]
907 pub fn player_fighting_style(player: IPlayer) -> i32 = [0, SLOT_GET_FIGHTING_STYLE] or 0;
908
909 /// `void IPlayer::setSkillLevel(PlayerWeaponSkill, int)`.
910 ///
911 /// # Safety
912 /// `player` must be a live `IPlayer`.
913 pub fn player_set_skill_level(
914 player: IPlayer,
915 skill: i32,
916 level: i32,
917 ) = [0, SLOT_SET_SKILL_LEVEL];
918
919 /// `void IPlayer::setAction(PlayerSpecialAction)`.
920 ///
921 /// # Safety
922 /// `player` must be a live `IPlayer`.
923 pub fn player_set_action(player: IPlayer, action: i32) = [0, SLOT_SET_ACTION];
924
925 /// `PlayerSpecialAction IPlayer::getAction()`.
926 ///
927 /// # Safety
928 /// `player` must be a live `IPlayer`.
929 #[must_use]
930 pub fn player_action(player: IPlayer) -> i32 = [0, SLOT_GET_ACTION] or 0;
931
932 /// `void IPlayer::setVelocity(Vector3)`.
933 ///
934 /// # Safety
935 /// `player` must be a live `IPlayer`.
936 pub fn player_set_velocity(player: IPlayer, velocity: Vector3) = [0, SLOT_SET_VELOCITY];
937
938 /// `Vector3 IPlayer::getVelocity()`.
939 ///
940 /// # Safety
941 /// `player` must be a live `IPlayer`.
942 #[must_use]
943 pub fn player_velocity(player: IPlayer) -> Vector3 = [0, SLOT_GET_VELOCITY] or Vector3::ZERO;
944
945 /// `const PlayerKeyData & IPlayer::getKeyData()`.
946 ///
947 /// # Safety
948 /// `player` must be a live `IPlayer`.
949 #[must_use]
950 pub fn player_key_data(
951 player: IPlayer,
952 ) -> *const PlayerKeyData = [0, SLOT_GET_KEY_DATA] or std::ptr::null();
953
954 /// `const StaticArray<uint16_t, NUM_SKILL_LEVELS> & IPlayer::getSkillLevels()`.
955 ///
956 /// # Safety
957 /// `player` must be a live `IPlayer`.
958 #[must_use]
959 pub fn player_skill_levels(
960 player: IPlayer,
961 ) -> *const [u16; 11] = [0, SLOT_GET_SKILL_LEVELS] or std::ptr::null();
962
963 /// `const PlayerAimData & IPlayer::getAimData()`.
964 ///
965 /// # Safety
966 /// `player` must be a live `IPlayer`.
967 #[must_use]
968 pub fn player_aim_data(
969 player: IPlayer,
970 ) -> *const PlayerAimData = [0, SLOT_GET_AIM_DATA] or std::ptr::null();
971
972 /// `const PlayerBulletData & IPlayer::getBulletData()`.
973 ///
974 /// # Safety
975 /// `player` must be a live `IPlayer`.
976 #[must_use]
977 pub fn player_bullet_data(
978 player: IPlayer,
979 ) -> *const PlayerBulletData = [0, SLOT_GET_BULLET_DATA] or std::ptr::null();
980
981 /// `void IPlayer::useCameraTargeting(bool)`.
982 ///
983 /// # Safety
984 /// `player` must be a live `IPlayer`.
985 pub fn player_use_camera_targeting(
986 player: IPlayer,
987 enable: bool,
988 ) = [0, SLOT_USE_CAMERA_TARGETING];
989
990 /// `bool IPlayer::hasCameraTargeting()`.
991 ///
992 /// # Safety
993 /// `player` must be a live `IPlayer`.
994 #[must_use]
995 pub fn player_has_camera_targeting(
996 player: IPlayer,
997 ) -> bool = [0, SLOT_HAS_CAMERA_TARGETING] or false;
998
999 /// `void IPlayer::removeFromVehicle(bool)`.
1000 ///
1001 /// # Safety
1002 /// `player` must be a live `IPlayer`.
1003 pub fn player_remove_from_vehicle(player: IPlayer, force: bool) = [0, SLOT_REMOVE_FROM_VEHICLE];
1004
1005 /// `IPlayer * IPlayer::getCameraTargetPlayer()`.
1006 ///
1007 /// # Safety
1008 /// `player` must be a live `IPlayer`.
1009 #[must_use]
1010 pub fn player_camera_target_player(
1011 player: IPlayer,
1012 ) -> *mut IPlayer = [0, SLOT_GET_CAMERA_TARGET_PLAYER] or std::ptr::null_mut();
1013
1014 /// `IVehicle * IPlayer::getCameraTargetVehicle()`.
1015 ///
1016 /// # Safety
1017 /// `player` must be a live `IPlayer`.
1018 #[must_use]
1019 pub fn player_camera_target_vehicle(
1020 player: IPlayer,
1021 ) -> *mut IVehicle = [0, SLOT_GET_CAMERA_TARGET_VEHICLE] or std::ptr::null_mut();
1022
1023 /// `IObject * IPlayer::getCameraTargetObject()`.
1024 ///
1025 /// # Safety
1026 /// `player` must be a live `IPlayer`.
1027 #[must_use]
1028 pub fn player_camera_target_object(
1029 player: IPlayer,
1030 ) -> *mut IObject = [0, SLOT_GET_CAMERA_TARGET_OBJECT] or std::ptr::null_mut();
1031
1032 /// `IActor * IPlayer::getCameraTargetActor()`.
1033 ///
1034 /// # Safety
1035 /// `player` must be a live `IPlayer`.
1036 #[must_use]
1037 pub fn player_camera_target_actor(
1038 player: IPlayer,
1039 ) -> *mut IActor = [0, SLOT_GET_CAMERA_TARGET_ACTOR] or std::ptr::null_mut();
1040
1041 /// `IPlayer * IPlayer::getTargetPlayer()`.
1042 ///
1043 /// # Safety
1044 /// `player` must be a live `IPlayer`.
1045 #[must_use]
1046 pub fn player_target_player(
1047 player: IPlayer,
1048 ) -> *mut IPlayer = [0, SLOT_GET_TARGET_PLAYER] or std::ptr::null_mut();
1049
1050 /// `IActor * IPlayer::getTargetActor()`.
1051 ///
1052 /// # Safety
1053 /// `player` must be a live `IPlayer`.
1054 #[must_use]
1055 pub fn player_target_actor(
1056 player: IPlayer,
1057 ) -> *mut IActor = [0, SLOT_GET_TARGET_ACTOR] or std::ptr::null_mut();
1058
1059 /// `void IPlayer::setRemoteVehicleCollisions(bool)`.
1060 ///
1061 /// # Safety
1062 /// `player` must be a live `IPlayer`.
1063 pub fn player_set_remote_vehicle_collisions(
1064 player: IPlayer,
1065 collide: bool,
1066 ) = [0, SLOT_SET_REMOTE_VEHICLE_COLLISIONS];
1067
1068 /// `void IPlayer::spectatePlayer(IPlayer &, PlayerSpectateMode)`.
1069 ///
1070 /// # Safety
1071 /// `player` must be a live `IPlayer`.
1072 pub fn player_spectate_player(
1073 player: IPlayer,
1074 target: *mut IPlayer,
1075 mode: i32,
1076 ) = [0, SLOT_SPECTATE_PLAYER];
1077
1078 /// `void IPlayer::spectateVehicle(IVehicle &, PlayerSpectateMode)`.
1079 ///
1080 /// # Safety
1081 /// `player` must be a live `IPlayer`.
1082 pub fn player_spectate_vehicle(
1083 player: IPlayer,
1084 target: *mut IVehicle,
1085 mode: i32,
1086 ) = [0, SLOT_SPECTATE_VEHICLE];
1087
1088 /// `const PlayerSpectateData & IPlayer::getSpectateData()`.
1089 ///
1090 /// # Safety
1091 /// `player` must be a live `IPlayer`.
1092 #[must_use]
1093 pub fn player_spectate_data(
1094 player: IPlayer,
1095 ) -> *const PlayerSpectateData = [0, SLOT_GET_SPECTATE_DATA] or std::ptr::null();
1096
1097 /// `void IPlayer::sendClientCheck(int, int, int, int)`.
1098 ///
1099 /// # Safety
1100 /// `player` must be a live `IPlayer`.
1101 pub fn player_send_client_check(
1102 player: IPlayer,
1103 action_type: i32,
1104 address: i32,
1105 offset: i32,
1106 count: i32,
1107 ) = [0, SLOT_SEND_CLIENT_CHECK];
1108
1109 /// `void IPlayer::toggleGhostMode(bool)`.
1110 ///
1111 /// # Safety
1112 /// `player` must be a live `IPlayer`.
1113 pub fn player_toggle_ghost_mode(player: IPlayer, toggle: bool) = [0, SLOT_TOGGLE_GHOST_MODE];
1114
1115 /// `bool IPlayer::isGhostModeEnabled()`.
1116 ///
1117 /// # Safety
1118 /// `player` must be a live `IPlayer`.
1119 #[must_use]
1120 pub fn player_is_ghost_mode_enabled(
1121 player: IPlayer,
1122 ) -> bool = [0, SLOT_IS_GHOST_MODE_ENABLED] or false;
1123
1124 /// `int IPlayer::getDefaultObjectsRemoved()`.
1125 ///
1126 /// # Safety
1127 /// `player` must be a live `IPlayer`.
1128 #[must_use]
1129 pub fn player_default_objects_removed(
1130 player: IPlayer,
1131 ) -> i32 = [0, SLOT_GET_DEFAULT_OBJECTS_REMOVED] or 0;
1132
1133 /// `bool IPlayer::getKickStatus()`.
1134 ///
1135 /// # Safety
1136 /// `player` must be a live `IPlayer`.
1137 #[must_use]
1138 pub fn player_kick_status(player: IPlayer) -> bool = [0, SLOT_GET_KICK_STATUS] or false;
1139
1140 /// `void IPlayer::clearTasks(PlayerAnimationSyncType)`.
1141 ///
1142 /// # Safety
1143 /// `player` must be a live `IPlayer`.
1144 pub fn player_clear_tasks(player: IPlayer, sync_type: i32) = [0, SLOT_CLEAR_TASKS];
1145
1146 /// `void IPlayer::allowWeapons(bool)`.
1147 ///
1148 /// # Safety
1149 /// `player` must be a live `IPlayer`.
1150 pub fn player_allow_weapons(player: IPlayer, allow: bool) = [0, SLOT_ALLOW_WEAPONS];
1151
1152 /// `bool IPlayer::areWeaponsAllowed()`.
1153 ///
1154 /// # Safety
1155 /// `player` must be a live `IPlayer`.
1156 #[must_use]
1157 pub fn player_are_weapons_allowed(
1158 player: IPlayer,
1159 ) -> bool = [0, SLOT_ARE_WEAPONS_ALLOWED] or false;
1160
1161 /// `void IPlayer::allowTeleport(bool)`.
1162 ///
1163 /// # Safety
1164 /// `player` must be a live `IPlayer`.
1165 pub fn player_allow_teleport(player: IPlayer, allow: bool) = [0, SLOT_ALLOW_TELEPORT];
1166
1167 /// `bool IPlayer::isTeleportAllowed()`.
1168 ///
1169 /// # Safety
1170 /// `player` must be a live `IPlayer`.
1171 #[must_use]
1172 pub fn player_is_teleport_allowed(
1173 player: IPlayer,
1174 ) -> bool = [0, SLOT_IS_TELEPORT_ALLOWED] or false;
1175
1176 /// `bool IPlayer::isUsingOfficialClient()`.
1177 ///
1178 /// # Safety
1179 /// `player` must be a live `IPlayer`.
1180 #[must_use]
1181 pub fn player_is_using_official_client(
1182 player: IPlayer,
1183 ) -> bool = [0, SLOT_IS_USING_OFFICIAL_CLIENT] or false;
1184
1185 /// `bool IPlayer::isUsingOmp()`.
1186 ///
1187 /// # Safety
1188 /// `player` must be a live `IPlayer`.
1189 #[must_use]
1190 pub fn player_is_using_omp(player: IPlayer) -> bool = [0, SLOT_IS_USING_OMP] or false;
1191}
1192
1193/// `StringView IPlayer::getClientVersionName()`.
1194///
1195/// # Safety
1196/// `player` must be a live `IPlayer`.
1197#[must_use]
1198pub unsafe fn player_client_version_name(player: *mut IPlayer) -> Option<String> {
1199 let view = call_vtable_small_struct!(
1200 player.cast::<u8>(),
1201 0,
1202 SLOT_GET_CLIENT_VERSION_NAME,
1203 StringView,
1204 StringView::EMPTY
1205 )?;
1206 unsafe { view.to_owned_string() }
1207}
1208
1209/// `StringView IPlayer::getSerial()`.
1210///
1211/// # Safety
1212/// `player` must be a live `IPlayer`.
1213#[must_use]
1214pub unsafe fn player_serial(player: *mut IPlayer) -> Option<String> {
1215 let view = call_vtable_small_struct!(
1216 player.cast::<u8>(),
1217 0,
1218 SLOT_GET_SERIAL,
1219 StringView,
1220 StringView::EMPTY
1221 )?;
1222 unsafe { view.to_owned_string() }
1223}
1224
1225/// `WeaponSlotData IPlayer::getWeaponSlot(int)`.
1226///
1227/// # Safety
1228/// `player` must be a live `IPlayer`.
1229#[must_use]
1230pub unsafe fn player_weapon_slot(player: *mut IPlayer, slot: i32) -> Option<WeaponSlotData> {
1231 call_vtable_small_struct!(
1232 player.cast::<u8>(),
1233 0,
1234 SLOT_GET_WEAPON_SLOT,
1235 WeaponSlotData,
1236 WeaponSlotData::default(),
1237 (i32)(slot)
1238 )
1239}
1240
1241/// `StringView IPlayer::getShopName()`.
1242///
1243/// # Safety
1244/// `player` must be a live `IPlayer`.
1245#[must_use]
1246pub unsafe fn player_shop_name(player: *mut IPlayer) -> Option<String> {
1247 let view = call_vtable_small_struct!(
1248 player.cast::<u8>(),
1249 0,
1250 SLOT_GET_SHOP_NAME,
1251 StringView,
1252 StringView::EMPTY
1253 )?;
1254 unsafe { view.to_owned_string() }
1255}
1256
1257/// `StringView IPlayer::lastPlayedAudio()`.
1258///
1259/// # Safety
1260/// `player` must be a live `IPlayer`.
1261#[must_use]
1262pub unsafe fn player_last_played_audio(player: *mut IPlayer) -> Option<String> {
1263 let view = call_vtable_small_struct!(
1264 player.cast::<u8>(),
1265 0,
1266 SLOT_LAST_PLAYED_AUDIO,
1267 StringView,
1268 StringView::EMPTY
1269 )?;
1270 unsafe { view.to_owned_string() }
1271}
1272
1273/// `Pair<Hours, Minutes> IPlayer::getTime()`.
1274///
1275/// # Safety
1276/// `player` must be a live `IPlayer`.
1277#[must_use]
1278pub unsafe fn player_time(player: *mut IPlayer) -> Option<Pair<Hours, Minutes>> {
1279 call_vtable_small_struct!(player.cast::<u8>(), 0, SLOT_GET_TIME, Pair<Hours, Minutes>, unsafe { std::mem::zeroed::<Pair<Hours, Minutes>>() })
1280}
1281
1282/// `PlayerAnimationData IPlayer::getAnimationData()`.
1283///
1284/// # Safety
1285/// `player` must be a live `IPlayer`.
1286#[must_use]
1287pub unsafe fn player_animation_data(player: *mut IPlayer) -> Option<PlayerAnimationData> {
1288 call_vtable_small_struct!(
1289 player.cast::<u8>(),
1290 0,
1291 SLOT_GET_ANIMATION_DATA,
1292 PlayerAnimationData,
1293 PlayerAnimationData::default()
1294 )
1295}
1296
1297// What the generator left out, and why.
1298// skipped: `void IPlayer::kick()` — `player_kick` is written by hand
1299// skipped: `bool IPlayer::isBot()` — `player_is_bot` is written by hand
1300// skipped: `StringView IPlayer::getName()` — `player_name` is written by hand
1301// skipped: `void IPlayer::setDrunkLevel(int)` — `player_set_drunk_level` is written by hand
1302// skipped: `void IPlayer::setControllable(bool)` — `player_set_controllable` is written by hand
1303// skipped: `void IPlayer::setWantedLevel(unsigned int)` — `player_set_wanted_level` is written by hand
1304// skipped: `unsigned int IPlayer::getWantedLevel()` — `player_wanted_level` is written by hand
1305// skipped: `void IPlayer::setMoney(int)` — `player_set_money` is written by hand
1306// skipped: `void IPlayer::giveMoney(int)` — `player_give_money` is written by hand
1307// skipped: `int IPlayer::getMoney()` — `player_money` is written by hand
1308// skipped: `void IPlayer::setHealth(float)` — `player_set_health` is written by hand
1309// skipped: `float IPlayer::getHealth()` — `player_health` is written by hand
1310// skipped: `void IPlayer::setScore(int)` — `player_set_score` is written by hand
1311// skipped: `int IPlayer::getScore()` — `player_score` is written by hand
1312// skipped: `void IPlayer::setArmour(float)` — `player_set_armour` is written by hand
1313// skipped: `float IPlayer::getArmour()` — `player_armour` is written by hand
1314// skipped: `void IPlayer::setTeam(int)` — `player_set_team` is written by hand
1315// skipped: `int IPlayer::getTeam()` — `player_team` is written by hand
1316// skipped: `void IPlayer::setSkin(int, bool)` — `player_set_skin` is written by hand
1317// skipped: `int IPlayer::getSkin()` — `player_skin` is written by hand
1318// skipped: `void IPlayer::setWeather(int)` — `player_set_weather` is written by hand
1319// skipped: `void IPlayer::setInterior(unsigned int)` — `player_set_interior` is written by hand
1320// skipped: `unsigned int IPlayer::getInterior()` — `player_interior` is written by hand