Player extensions of the Animations plugin: starting and leaving an animation, and asking which one a player is playing. The server does the work; a client can only ask the server on behalf of its own local player.

Summary

Methods

Returns the animation of the Animations plugin that the player is playing.
Makes the player leave the animation they are playing, with its exit sequence if it has one, see Animations:leave.
Makes the player play a registered animation, see Animations:play.

Methods

Player:get_played_animation()

shared plugins/animations/plugin/lib/meta/sh_player.lua:45

Returns the animation of the Animations plugin that the player is playing.

Returns

  • String ID of the animation, nil if the player is not playing one

Player:leave_animation()

shared plugins/animations/plugin/lib/meta/sh_player.lua:31

Makes the player leave the animation they are playing, with its exit sequence if it has one, see Animations:leave. Clientside it asks the server to do so for the local player and does nothing when called on another player.

Returns

  • Boolean false if the player is not playing an animation; nothing clientside

Player:play_animation(id)

shared plugins/animations/plugin/lib/meta/sh_player.lua:15

Makes the player play a registered animation, see Animations:play. Clientside it asks the server to start the animation for the local player, or to make them leave the one they are playing, as the context menu does; the server notifies the player if it refuses. Does nothing clientside when called on another player.

Parameters

  • id String ID of the registered animation

Returns

  • Boolean whether the animation has started
  • String phrase that says why not
  • Map arguments of the phrase or nil; nothing clientside

Defined in