Garry's Mod Wiki

Revision Difference

GM:CalcMainActivity#511404

<function name="CalcMainActivity" parent="GM" type="hook">⤶ <ishook>yes</ishook>⤶ <description>⤶ This hook is used to calculate animations for a player.⤶ ⤶ <warning>This hook must return the same values at the same time on both, client **and** server. On client for players to see the animations, on server for hit detection to work properly.</warning>⤶ <bug issue="3322">This can return the incorrect velocity when on a moving object.</bug>⤶ </description>⤶ <realm>Shared</realm>⤶ <predicted>No</predicted>⤶ <args>⤶ <arg name="ply" type="Player">The player to apply the animation.</arg>⤶ <arg name="vel" type="Vector">The velocity of the player.</arg>⤶ </args>⤶ <rets>⤶ <ret name="" type="number"><page>ACT</page> for the activity the player should use. A nil return will be treated as ACT_INVALID.</ret>⤶ <ret name="" type="number">Sequence for the player to use. This takes precedence over the activity (the activity is still used for layering). Return -1 or nil to let the activity determine the sequence.</ret>⤶ </rets>⤶ </function>⤶ ⤶