Sometimes you often find the animation is stuck / bugs on your server / people, until you immigration and relog. Here's an example to solve the stuck animation.
RegisterCommand("animfix", function(source,args,rawCommand)local ped =GetPlayerPed(-1)local isDead =falseifnotIsEntityInAir(ped) thenifnotIsPedRagdoll(ped) thenifnotIsPedInAnyVehicle(ped) thenClearPedTasksImmediately(ped)ClearPedSecondaryTask(ped)SetPedCanPlayGestureAnims(ped, true)else exports['gusti-notify']:SendAlert('inform', 'You can\'t use this command while you\'re in a car.', 3000)
endelse exports['gusti-notify']:SendAlert('inform', 'You can\'t use this command if you\'re not standing.', 3000)endelse exports['gusti-notify']:SendAlert('inform', 'You can\'t use this command if you\'re in the air.', 3000)endend, false)CreateThread(function() TriggerEvent('chat:addSuggestion', '/animfix', 'Use this command if your animation gets bugged. It will stop your animation and save you.')
end)