💻
alt:V Athena Docs v3.0.0
  • Info
    • Introduction
    • Patreon & Support
    • Athena Discord
    • FAQ
  • Installation
    • Common Issues
    • Windows
    • Linux (Ubuntu 20.04+)
    • Debugging
    • Updating
  • Info
    • Admin
    • Configuration
    • Console
    • Database
    • Hotkeys
    • Identifier
  • Plugins
    • Load Plugins
    • Create Plugins
    • Mods
    • Clothing
  • Controllers
    • What is a Controller?
    • Blip Controller
    • Interaction Controller
    • Marker Controller
    • Object Controller
    • Ped Controller
    • Text Label Controller
    • World Notification Controller
  • Systems
    • Interiors
    • Inventory & Items
    • Inventory Rules
    • Jobs
    • Time
    • Weather
  • Menus
    • Menu Types
    • Action Menus
    • Input Menu
    • Wheel Menu
  • Player
    • Admin-Commands
    • Animations
    • Attach Objects
    • Credits
    • Currency
    • Commands
    • Error Screen
    • Message
    • Meta
    • Notifications
    • Particle
    • Progress Bar
    • Save
    • Shard
    • Sound
    • Spinners
    • Task Timeline
  • Custom WebViews
    • Introduction
    • Your First Page
    • CSS Framework
  • Misc
    • Custom Sounds
    • Custom Streamers
    • Custom Icons
    • Adding Locale / Translations
    • Adding Vehicle Rules
    • Adding Whitelist
    • Adding Wheel Menus
    • Adding Parking Garages
Powered by GitBook
On this page
  • Animation Flags
  • Usage
  • Stopping Animation
  • Scenarios
Edit on GitHub
  1. Player

Animations

Animations can be played from server-side.

In most cases you'll be wanting to play an animation from server-side as that's where a majority of our logic is going to be written. There's a player function to do this with ease.

Animation Flags

Animation flags are a way to specify how an animation looks in-game. They're built around bitwise functionality so you combine a handful of them to get the desired effect you want.

export enum ANIMATION_FLAGS {
    NORMAL = 0,
    REPEAT = 1,
    STOP_LAST_FRAME = 2,
    UPPERBODY_ONLY = 16,
    ENABLE_PLAYER_CONTROL = 32,
    CANCELABLE = 120
}

Example

const foreverLastFrame = ANIMATION_FLAGS.STOP_LAST_FRAME | ANIMATION_FLAGS.UPPERBODY_ONLY;

Usage

Playing an animation can be done like this...

Input Values

// Plays an animation forever.
Athena.player.emit.animation(player, 'dictionary', 'name', flags, -1);

Example

// Plays for 12 seconds.
Athena.player.emit.animation(
    player,
    'mp_car_bomb',
    'car_bomb_mechanic',
    ANIMATION_FLAGS.NORMAL | ANIMATION_FLAGS.REPEAT,
    12000,
);

Stopping Animation

If you ever find yourself needing to stop an animation there's a simple function to clear it.

Athena.player.emit.clearAnimation(player);

Scenarios

Scenarios are just really complex animations that are generally long.

// Plays for 10 seconds.
playerFuncs.emit.scenario(player, `WORLD_HUMAN_AA_SMOKE`, 10000);
PreviousAdmin-CommandsNextAttach Objects

Last updated 3 years ago

Scenario List