pub struct Actor { /* private fields */ }Expand description
Main handler pointing to open.mp’s Actor object
Implementations§
Source§impl Actor
impl Actor
pub fn get_handle(&self) -> *const c_void
pub fn new(handle: *const c_void) -> Self
Sourcepub fn create_actor(skin: i32, pos: Vector3, angle: f32) -> Option<Actor>
pub fn create_actor(skin: i32, pos: Vector3, angle: f32) -> Option<Actor>
Create a static ‘actor’ in the world. These ‘actors’ are like NPCs, however they have limited functionality. They do not take up server player slots.
Sourcepub fn is_streamed_in(&self, player: &Player) -> bool
pub fn is_streamed_in(&self, player: &Player) -> bool
Checks if an actor is streamed in for a player.
Sourcepub fn set_virtual_world(&self, virtual_world: i32) -> bool
pub fn set_virtual_world(&self, virtual_world: i32) -> bool
Sets an actor’s virtual world
Sourcepub fn get_virtual_world(&self) -> i32
pub fn get_virtual_world(&self) -> i32
Get the virtual world of an actor.
Sourcepub fn apply_animation(&self, animation_data: AnimationData) -> bool
pub fn apply_animation(&self, animation_data: AnimationData) -> bool
Apply an animation to an actor.
Sourcepub fn clear_animations(&self) -> bool
pub fn clear_animations(&self) -> bool
Clear any animations that are applied to an actor.
Sourcepub fn set_facing_angle(&self, angle: f32) -> bool
pub fn set_facing_angle(&self, angle: f32) -> bool
Set the facing angle of an actor.
Sourcepub fn get_facing_angle(&self) -> f32
pub fn get_facing_angle(&self) -> f32
Get the facing angle of an actor.
Sourcepub fn set_health(&self, health: f32)
pub fn set_health(&self, health: f32)
Set the health of an actor.
Sourcepub fn get_health(&self) -> f32
pub fn get_health(&self) -> f32
Get the health of an actor
Sourcepub fn set_invulnerable(&self, invulnerable: bool) -> bool
pub fn set_invulnerable(&self, invulnerable: bool) -> bool
Set actor invulnerability
Sourcepub fn is_invulnerable(&self) -> bool
pub fn is_invulnerable(&self) -> bool
Check if actor is invulnerable.
Sourcepub fn get_animation(&self) -> AnimationData
pub fn get_animation(&self) -> AnimationData
Get the animation the actor is currently performing.
Sourcepub fn get_spawn_info(&self) -> ActorSpawnData
pub fn get_spawn_info(&self) -> ActorSpawnData
Get the initial spawn point of the actor.
Auto Trait Implementations§
impl Freeze for Actor
impl RefUnwindSafe for Actor
impl !Send for Actor
impl !Sync for Actor
impl Unpin for Actor
impl UnwindSafe for Actor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more