Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'to activate the script press " to show the scripthook console, then type pd to activate
- '"
- 'pd
- 'enter
- '
- Imports System
- Imports System.Windows.Forms
- Imports GTA
- Imports System.IO
- Public Class PTFXDemo
- Inherits Script
- private bSOn as boolean = false
- Private l As Int32 = 0
- Private linhas As String()
- Private effect As Int32
- private coef as int16 = 1
- private effectSize as double = 1.0
- private sFilter as string = ""
- Public Sub New()
- Me.Interval = 100
- linhas = File.ReadAllLines(".\scripts\particlesFx.txt")
- End Sub
- private sub console_CMD(ByVal sender As Object, ByVal e As ConsoleEventArgs) Handles MyBase.ConsoleCommand
- if e.command = "pd" then
- bSOn = not bSOn
- if bSOn then
- msg("PTFXDemo ON - Left/Right/Numpad0/+/-", 3000)
- else
- msg("PTFXDemo OFF", 3000)
- end if
- end if
- if e.command = "pfilter" then
- if e.parameterCount = 0 then
- game.console.print("Particle FX filter: " & sFilter)
- else
- sFilter = e.parameter(0).tolower
- l = 0
- end if
- end if
- 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
- Shadows Sub keyDown(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyDown
- if not bSOn then exit sub
- If e.Key = Keys.Right Then nextL()
- If e.Key = Keys.Left Then priorL()
- if e.key = keys.add then
- if effectSize >= 0.5 then
- effectSize += 0.5
- else
- effectSize += 0.1
- end if
- msg("Size: " & effectSize.tostring, 3000)
- end if
- if e.key = keys.subtract then
- if effectSize > 0.5 then
- effectSize -= 0.5
- else
- effectSize -= 0.1
- end if
- msg("Size: " & effectSize.tostring, 3000)
- end if
- if e.key = keys.numpad0 then
- coef = 0
- playEffect
- msg("Replay: " & lerLinha, 5000)
- end if
- End Sub
- private sub playEffect
- Dim sTmp As String
- sTmp = lerLinha
- If sTmp.Length > 0 Then
- Native.Function.Call("STOP_PTFX", effect)
- effect = Native.Function.Call(Of Int32)("START_PTFX_ON_PED_BONE", sTmp, Player.Character, 0, 0, 1.5, 0, 0, 0, bone.head, effectSize)
- msg(sTmp, 5000)
- End If
- end sub
- Private Function lerLinha
- Dim sTmp As String
- sTmp = ""
- While sTmp = ""
- l += coef
- If l < 0 Then
- l = 0
- Exit While
- End If
- If l > linhas.Length - 1 Then
- l = linhas.Length - 1
- Exit While
- End If
- sTmp = linhas(l)
- If ((sTmp.Trim.Length = 0) OrElse (sTmp.Substring(0, 1) <> " ")) _
- orelse ((sFilter <> "") andalso not sTmp.tolower.contains(sFilter)) Then
- sTmp = ""
- if coef <> 0 then
- l += coef
- else
- l += 1
- end if
- Else
- Exit While
- End If
- End While
- Return sTmp.Trim
- End Function
- Private Sub nextL()
- coef = 1
- playEffect
- End Sub
- Private Sub priorL()
- coef = -1
- playEffect
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement