Garry's Mod Wiki

ENTITY:HandleAnimEvent

  boolean ENTITY:HandleAnimEvent( number event, number eventTime, number cycle, number type, string options )

Description

Called before firing serverside animation events, such as weapon reload, drawing and holstering for NPCs, scripted sequences, etc.

See ENTITY:FireAnimationEvent for the clientside version.

This hook only works on "anim", "ai" and "nextbot" type entities.

Arguments

1 number event
The event ID of happened even. See this page.
2 number eventTime
The absolute time this event occurred using CurTime.
3 number cycle
The frame this event occurred as a number between 0 and 1.
4 number type
Event type. See the Source SDK.
5 string options
Name or options of this event.

Returns

1 boolean
Return true to mark the event as handled