Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'http://gtaxscripting.blogspot.com/
- 'http://www.facebook.com/GtaIVScripting
- 'https://www.youtube.com/user/GTAScripting
- 'tutorial related to this code:
- 'http://gtaxscripting.blogspot.com.br/2013/06/tut-animations.html
- Imports System
- Imports System.Drawing
- Imports System.Windows.Forms
- Imports GTA
- Imports System.IO
- Imports System.Text
- Public Class BaseScriptProject
- Inherits Script
- Private AnimSet As AnimationSet
- Private AnimName As String = "run"
- Public Sub New()
- Me.Interval = 10
- AnimSet = New AnimationSet("swimming")
- Native.Function.Call("REQUEST_ANIMS", "swimming")
- Native.Function.Call("REQUEST_ANIMS", "move_rpg")
- End Sub
- Private Sub msg(ByVal smsg As String, ByVal duracao As Int32)
- Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", smsg, duracao, 1)
- End Sub
- Private Sub keyDown(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyDown
- If e.Key = Keys.NumPad0 Then
- Player.Character.Animation.Play(AnimSet, AnimName, 8)
- msg("anim with no flags", 3000)
- End If
- If e.Key = Keys.NumPad1 Then
- Player.Character.Animation.Play(AnimSet, AnimName, 8, AnimationFlags.Unknown01)
- msg("anim with flags Unknown01 - Don't come back to initial position", 3000)
- End If
- If e.Key = Keys.NumPad2 Then
- Player.Character.Animation.Play(AnimSet, AnimName, 8, AnimationFlags.Unknown01 Or AnimationFlags.Unknown05)
- msg("anim with flags Unknown01 and Unknown05 - Unknown01 and loop animation", 3000)
- End If
- If e.Key = Keys.NumPad3 Then
- Player.Character.Animation.Play(AnimSet, AnimName, 8, AnimationFlags.Unknown01 Or AnimationFlags.Unknown05 Or AnimationFlags.Unknown10)
- msg("anim with flags Unknown01 and Unknown05 - Unknown01, Unknown05 and remove animation sounds", 3000)
- End If
- If e.Key = Keys.NumPad4 Then
- Dim p1_Repeat, p2, p3, p4_Stop_On_last_frame As Boolean
- Dim timeOfPlayback As Int16 = 0
- p1_Repeat = False
- p2 = False
- p3 = False
- p4_Stop_On_last_frame = True
- Native.Function.Call("TASK_PLAY_ANIM_SECONDARY_UPPER_BODY", Player.Character, "idle", "swimming", 8.0, _
- p1_Repeat, p2, p3, p4_Stop_On_last_frame, timeOfPlayback)
- End If
- If e.Key = Keys.NumPad5 Then
- Native.Function.Call("TASK_PLAY_ANIM_SECONDARY_IN_CAR", Player.Character, "idle", "swimming", 8.0, 0, 0, 0, 0, 0)
- End If
- If e.Key = Keys.Back Then
- Player.Character.Task.ClearAllImmediately()
- End If
- If e.Key = Keys.Add Then
- msg("move as move_rpg", 2000)
- Native.Function.Call("SET_ANIM_GROUP_FOR_CHAR", Player.Character, "move_rpg")
- End If
- If e.Key = Keys.Subtract Then
- msg("move as move_player", 2000)
- Native.Function.Call("SET_ANIM_GROUP_FOR_CHAR", Player.Character, "move_player")
- End If
- End Sub
- Private Sub keyUp(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyUp
- End Sub
- Private Sub general_tick(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Tick
- If Player.Character.Animation.isPlaying(AnimSet, AnimName) Then
- msg(Player.Character.Animation.GetCurrentAnimationTime(AnimSet, AnimName).ToString, 150)
- End If
- If Player.Character.Animation.isPlaying(AnimSet, "idle") Then
- Dim tmpTime As Native.Pointer = New Native.Pointer(GetType(Single))
- Native.Function.Call("GET_CHAR_ANIM_CURRENT_TIME", Player.Character, "swimming", "idle", tmpTime)
- msg("playing idle animation of swimming category Anim Time: " & _
- tmpTime.ToString, 1000)
- End If
- If Game.isGameKeyPressed(GameKey.Sprint) Then
- Native.Function.Call("SET_CHAR_ALL_ANIMS_SPEED", Player.Character, 1.5)
- End If
- If Game.isKeyPressed(Keys.MButton) Then
- Native.Function.Call("SET_CHAR_ANIM_SPEED", Player.Character, "swimming", "idle", 5.0)
- End If
- If Game.isKeyPressed(Keys.NumPad9) Then
- Native.Function.Call("SET_CHAR_ANIM_CURRENT_TIME", Player.Character, "swimming", "idle", 0.1)
- End If
- End Sub
- Private Sub console_CMD(ByVal sender As Object, ByVal e As ConsoleEventArgs) Handles MyBase.ConsoleCommand
- End Sub
- Private Sub GraphicsEventHandler(ByVal sender As Object, ByVal e As GTA.GraphicsEventArgs) Handles MyBase.PerFrameDrawing
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement