Recently I saw on a server that when you ate or drank you could keep walking the character did not stop, he could even eat running and everything
On my server, when I give the inventory and select a food or drink, even if I have pressed the button w to walk the weighing it is stopped, until the animation ends
So obviously you will be using this native TaskPlayAnim() and you will fill out your parameters. So it looks like this TaskPlayAnim("PlayerPedId(), "animDict", "animName", 8.0, -8, length_here, flag_here, false, false, false, false), all you need to change for character control is the flag. Here is some info on the flag from the native post.
Odd number : loop infinitely Even number : Freeze at last frame Multiple of 4: Freeze at last frame but controllable 01 to 15 > Full body 10 to 31 > Upper body 32 to 47 > Full body > Controllable 48 to 63 > Upper body > Controllable