PlayerObject

Struct PlayerObject 

Source
pub struct PlayerObject {
    pub player: Player,
    /* private fields */
}

Fields§

§player: Player

Implementations§

Source§

impl PlayerObject

Source

pub fn get_handle(&self) -> *const c_void

Source

pub fn new(handle: *const c_void, player: Player) -> Self

Source

pub fn attach_player_object_to_vehicle( &self, vehicle: &Vehicle, offset: Vector3, rotation: Vector3, ) -> bool

Attach a player object to a vehicle.

Source

pub fn attach_player_object_to_player( &self, player_attached_to: &Player, offset: Vector3, rotation: Vector3, ) -> bool

Attach PlayerObject to another player

Source

pub fn attach_player_object_to_object( &self, attached_to: &PlayerObject, offset: Vector3, rotation: Vector3, ) -> bool

You can use this function to attach player-objects to other player-objects.

Source

pub fn set_player_object_pos(&self, position: Vector3) -> bool

Sets the position of a player-object to the specified coordinates.

Source

pub fn get_player_object_pos(&self) -> Vector3

Get the position of a player object (CreatePlayerObject).

Source

pub fn set_player_object_rotation(&self, rotation: Vector3) -> bool

Set the rotation of an object on the X, Y and Z axis.

Source

pub fn get_player_object_rotation(&self) -> Vector3

Use this function to get the object’s current rotation.

Source

pub fn get_player_object_model(&self) -> i32

Retrieve the model ID of a player-object.

Source

pub fn set_player_object_no_camera_collision(&self) -> bool

Toggles a player object camera collision.

Source

pub fn move_player_object(&self, data: ObjectMoveData) -> i32

Move a player object with a set speed.

Source

pub fn stop_player_object(&self) -> bool

Stop a moving player-object after MovePlayerObject has been used.

Source

pub fn is_player_object_moving(&self) -> bool

Checks if the given player objectid is moving.

Source

pub fn set_player_object_material( &self, material_index: i32, model_id: i32, texture_library: &str, texture_name: &str, material_colour: Colour, ) -> bool

Replace the texture of a player-object with the texture from another model in the game.

Source

pub fn set_player_object_material_text( &self, text: &str, material_index: i32, material_size: i32, fontface: &str, fontsize: i32, bold: bool, font_colour: Colour, background_colour: Colour, textalignment: ObjectMaterialTextAlign, ) -> bool

Replace the texture of a player object with text.

Source

pub fn get_player_object_draw_distance(&self) -> f32

Get the draw distance of a player-object.

Source

pub fn get_player_object_move_speed(&self) -> f32

Get the move speed of a player-object.

Source

pub fn get_player_object_moving_data(&self) -> ObjectMoveData

Source

pub fn get_player_object_attached_data(&self) -> ObjectAttachmentData

Get the attachment data of a player-object.

Source

pub fn is_player_object_material_slot_used(&self, material_index: i32) -> bool

Checks if a slot of player-object material is used.

Source

pub fn get_player_object_material_data( &self, material_index: i32, ) -> ObjectMaterialData

Source

pub fn is_player_object_no_camera_collision(&self) -> bool

Check if collisions between players’ cameras and the specified player object is disabled.

Source

pub fn get_id(&self) -> i32

Get player object’s id

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.