Advertisement
Guest User

BlaBla User20192910291

a guest
Feb 12th, 2024
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. using System;
  2. using GTA;
  3. using GTA.Native;
  4. using System.Windows.Forms;
  5.  
  6. public class StopAnimationScript : Script
  7. {
  8. public StopAnimationScript()
  9. {
  10. Tick += OnTick;
  11. KeyDown += OnKeyDown;
  12. }
  13.  
  14. private void OnTick(object sender, EventArgs e)
  15. {
  16. }
  17.  
  18. private void OnKeyDown(object sender, KeyEventArgs e)
  19. {
  20. if (e.KeyCode == Keys.F2)
  21. {
  22. StopAllAnimations();
  23. }
  24. }
  25.  
  26. private void StopAllAnimations()
  27. {
  28. Ped player = Game.Player.Character;
  29. Function.Call(Hash.CLEAR_PED_TASKS, player.Handle);
  30. Function.Call(Hash.CLEAR_PED_TASKS_IMMEDIATELY, player.Handle);
  31. }
  32. }
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement