Skip to content

ax.animations

Animation library

Documented functions: 7  ·  Realm: server, shared

Functions


ax.animations:GetFlinchGesture(modelClass, hitGroup)

Returns the flinch gesture sequence name for a model class and hitgroup.

Realm: shared

Parameters

Name Type Description
modelClass string The model class (e.g. "citizen_male")
hitGroup number The HITGROUP_* constant

Returns

  • string|nil: The gesture sequence name, or nil if none defined

Source: gamemode/modules/animations/libraries/sh_animations.lua:597


ax.animations:GetModelClass(model)

Gets the model class for a specific model.

Realm: shared

Parameters

Name Type Description
model The model to get the class for.

Returns

  • The: model class.

Source: gamemode/modules/animations/libraries/sh_animations.lua:630


ax.animations:ResolveWeaponActivity(client, act, activityData)

Resolves an activity entry for the player's current raised state.

Weapons can override raised animations by implementing:

function SWEP:GetWeaponRaisedActivity(client, act, loweredActivity, raisedActivity, activityData, holdType)

Realm: shared

Source: gamemode/modules/animations/libraries/sh_animations.lua:654


ax.animations:SetModelClass(model, class)

Sets a model class translation for a specific model.

Realm: shared

Parameters

Name Type Description
model The model to set the translation for.
class The class to set the translation to.

Source: gamemode/modules/animations/libraries/sh_animations.lua:612


ax.animations:ApplyForcedSequenceTiming(client, sequence, sequenceTime)

Applies timing behavior for a forced sequence on a player.

Non-zero sequence times create an automatic leave timer. A zero time marks the sequence as looping until the player cancels it.

Realm: server

Parameters

Name Type Description
client Player The player currently in the forced sequence.
sequence string\|number The sequence identifier, used for debug output.
sequenceTime number Duration in seconds. Use 0 for a looping/cancellable sequence.

Returns

  • number: The normalized sequence duration in seconds.

Source: gamemode/modules/animations/meta/sh_player.lua:160


ax.animations:ClearForcedSequencePending(client)

Clears any pending client-authoritative sequence resolution for a player.

Removes the stored pending resolve entry and its timeout timer.

Realm: server

Parameters

Name Type Description
client Player The player whose pending forced sequence resolve should be cleared.

Source: gamemode/modules/animations/meta/sh_player.lua:146


ax.animations:ResolveForcedSequencePending(client, serial, sequenceTime)

Resolves a pending forced sequence timing request from the client.

Validates the pending serial and current sequence identifier to ignore stale or mismatched responses.

On success, clears the pending entry and applies the supplied sequence timing.

Realm: server

Parameters

Name Type Description
client Player The player that resolved the sequence.
serial number The forced sequence serial sent to the client.
sequenceTime number Resolved duration in seconds.

Returns

  • boolean: True if the pending resolve was accepted.
  • number|string: Applied sequence time on success, or an error message on failure.

Source: gamemode/modules/animations/meta/sh_player.lua:201