This hook is called when the server receives an Animation packet (0x12) from the client.
For the list of animations that are sent by the client, see the
Protocol wiki.
Callback function
The default name for the callback function is OnPlayerAnimation. It has the following signature:
function OnPlayerAnimation(Player, Animation)
Parameters:
Name | Type | Notes |
Player | cPlayer | The player from whom the packet was received |
Animation | number | The kind of animation |
If the function returns false or no value, the next plugin's callback is called. Afterwards, the
server broadcasts the animation packet to all nearby clients. If the function returns true, no other
callback is called for this event and the packet is not broadcasted.
Code examplesRegistering the callback
cPluginManager:AddHook(cPluginManager.HOOK_PLAYER_ANIMATION, MyOnPlayerAnimation);
|