Player::taskPlayAnim

From RAGE Multiplayer Wiki
Jump to navigation Jump to search

Plays an animation on the targetted ped.

CLIENTSIDE: You must always preload the dictionary (use Streaming::requestAnimDict to preload an animation), serverside will have some loaded but not all.

Arguments

Speed:

  • Normal speed is
8.0f

Speed Multiplier: Multiply the playback speed

Duration:

  • -1 (Default)
  • 0 (No Animation at all)
  • Small value (Slows the animation)
  • Other values (Freezes the player till ms was passed) (No effect if flag is set to be controllable.)

Animation Flags :

  • NORMAL = 0,
  • REPEAT = 1,
  • STOP_LAST_FRAME = 2,
  • UPPERBODY = 16,
  • ENABLE_PLAYER_CONTROL = 32,
  • CANCELABLE = 120,
  • Odd number : loop infinitely
  • Even number : Freeze at last frame
  • Multiple of 4: Freeze at last frame but controllable
  • 01 to 15 : Full body
  • 10 to 31 : Upper body
  • 32 to 47 : Full body > Controllable
  • 48 to 63 : Upper body > Controllable
  • 001 to 255 : Normal
  • 256 to 511 : Garbled


PlaybackRate:

  • values are between 0.0 and 1.0

Syntax

player.taskPlayAnim(animDictionary, animationName, blendInSpeed, blendOutSpeed, duration, flag, playbackRate, lockX, lockY, lockZ);

Required Arguments

  • animDictionary: String
  • animationName: String
  • blendInSpeed: float
  • blendOutSpeed: float
  • duration: int
  • flag: int
  • playbackRate: float
  • lockX: Boolean
  • lockY: Boolean
  • lockZ: Boolean

Return value

  • Undefined

Example

The example below preloads an animation and applies it into the local player.

mp.game.streaming.requestAnimDict("[email protected]_robbery");//preload the animation
mp.players.local.taskPlayAnim("[email protected]_robbery", "robbery_action_f", 8.0, 1.0, -1, 1, 1.0, false, false, false);

See also