Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System ' basic imports
- Imports GTA ' basic imports
- Imports System.Windows.Forms ' needed to have access to "keys" enumeration, for example
- Imports System.Drawing ' needed to handle colors referencing the color name, ex: myCar.color = System.Drawing.Color.Black
- Public Class BasicScript
- Inherits Script
- private myIntVar as int32
- private myStringVar as string
- private myHotKey as int32
- Public Sub New()
- Me.interval = 10
- if Settings.GetValueInteger("myIntVar", "EXAMPLE1", -1) = -1 then Settings.SetValue("myIntVar", "EXAMPLE1", 0)
- if Settings.GetValueString("myStringVar", "EXAMPLE1", "") = "" then Settings.SetValue("myStringVar", "EXAMPLE1", "myDefault")
- if Settings.GetValueKey("myHotKey", "EXAMPLE2", -1) = -1 then Settings.SetValue("myHotKey", "EXAMPLE2", keys.O)
- Settings.save
- myIntVar = Settings.GetValueInteger("myIntVar", "EXAMPLE1", 0)
- myStringVar = Settings.GetValueString("myStringVar", "EXAMPLE1", "default")
- myHotKey = Settings.GetValueKey("myHotKey", "EXAMPLE2", keys.A)
- End Sub
- private sub msg(sMsg as string, time as int32)
- Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", sMsg, time, 1)
- end sub
- Private Sub keyDown(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyDown
- if e.key = myHotKey then player.character.die
- Settings.SetValue("myKey" & e.key.tostring, "Keys", e.key)
- Settings.save
- End Sub
- Private Sub keyUp(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyUp
- end sub
- private sub cmd(ByVal sender As Object, ByVal e As GTA.ConsoleEventArgs) Handles MyBase.ConsoleCommand
- if e.parametercount > 0 then
- dim myStr as string = ""
- dim myVec as vector3
- for c as int16 = 0 to e.parametercount - 1
- myStr &= " " & e.parameter(c)
- if c = 0 then myVec.x = convert.toint32(e.parameter(c))
- if c = 1 then myVec.y = convert.toint32(e.parameter(c))
- if c = 2 then myVec.z = convert.toint32(e.parameter(c))
- next
- msg(e.command & " params " & myStr, 20000)
- player.character.velocity = myVec
- else
- msg(e.command, 2000)
- end if
- end sub
- Private Sub general_tick(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Tick
- 'msg("myIntVar " & myIntVar.tostring & " myStringVar " & myStringVar & " myHotKey " & myHotKey.tostring, 15)
- end sub
- function rotateVec(vec as vector3, angle as double)
- angle = angle * (3.1415 / 180)
- dim s as double = system.math.sin(angle)
- dim c as double = system.math.cos(angle)
- vec.x = vec.x * c - vec.y * s
- vec.y = vec.x * s + vec.y * c
- return vec
- end function
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement