Advertisement
julioCCs

GTA V Play ped anim sample

Jun 24th, 2016
4,833
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.90 KB | None | 0 0
  1. Private Sub keyDown(ByVal sender As Object, ByVal e As KeyEventArgs) Handles MyBase.KeyDown
  2.         If e.KeyCode = Keys.None Then
  3.             Exit Sub
  4.         End If
  5.  
  6.         If e.KeyCode = Keys.T Then
  7.             Native.Function.Call(Native.Hash.REQUEST_ANIM_DICT, "combat@chg_stance")
  8.  
  9.             Dim tmpTimeOut As Date = Now
  10.  
  11.             While Not Native.Function.Call(Of Boolean)(Native.Hash.HAS_ANIM_DICT_LOADED, "combat@chg_stance") AndAlso (Now.Subtract(tmpTimeOut).TotalMilliseconds < 500)
  12.                 Wait(5)
  13.             End While
  14.  
  15.             If Native.Function.Call(Of Boolean)(Native.Hash.HAS_ANIM_DICT_LOADED, "combat@chg_stance") Then
  16.                 Native.Function.Call(Native.Hash.TASK_PLAY_ANIM, Game.Player.Character, "combat@chg_stance", "aimb_loop", 8.0, 8.0 * -1, -1, 0, 0, False, False, False)
  17.  
  18.                 Wait(50)
  19.  
  20.                 tmpTimeOut = Now
  21.  
  22.                 While Now.Subtract(tmpTimeOut).TotalMilliseconds < 3000
  23.                     UI.ShowSubtitle("Anim play time: " & Native.Function.Call(Of Double)(Native.Hash.GET_ENTITY_ANIM_CURRENT_TIME, Game.Player.Character, "combat@chg_stance", "aimb_loop"))
  24.  
  25.                     Wait(5)
  26.                 End While
  27.  
  28.                 UI.ShowSubtitle("Reset anim playback time to 0.1 and reduce play speed to 0.25", 5000)
  29.  
  30.                 Native.Function.Call(Native.Hash.SET_ENTITY_ANIM_CURRENT_TIME, Game.Player.Character, "combat@chg_stance", "aimb_loop", 0.1)
  31.  
  32.                 Native.Function.Call(Native.Hash.SET_ENTITY_ANIM_SPEED, Game.Player.Character, "combat@chg_stance", "aimb_loop", 0.25)
  33.  
  34.                 Wait(5000)
  35.  
  36.                 UI.ShowSubtitle("End anim playback")
  37.  
  38.                 Native.Function.Call(Native.Hash.STOP_ANIM_TASK, Game.Player.Character, "combat@chg_stance", "aimb_loop", 1.0)
  39.             Else
  40.                 UI.ShowSubtitle("Error requesting dict")
  41.             End If
  42.         End If
  43. end sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement