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
- Imports System.IO
- Public Class BasicScript
- Inherits Script
- private myFont as gta.font
- private myKeyPressed as System.Windows.Forms.keys = 0
- private mySpeedoBack as texture = nothing
- private mySpeedoArrow as texture = nothing
- Public Sub New()
- Me.interval = 10
- myFont = new gta.font
- myFont.color = System.Drawing.Color.white
- try
- if file.exists(".\scripts\SpeedoMBack.png") then mySpeedoBack = new Texture(File.ReadAllBytes(".\scripts\SpeedoMBack.png"))
- if file.exists(".\scripts\SpeedoMG.png") then mySpeedoArrow = new Texture(File.ReadAllBytes(".\scripts\SpeedoMG.png"))
- catch
- end try
- 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
- myKeyPressed = e.key
- 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
- end sub
- Private Sub general_tick(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Tick
- if game.iskeypressed(keys.shiftkey) andalso exists(player.character.currentvehicle) then player.character.currentvehicle.applyforce(player.character.currentvehicle.direction)
- end sub
- public sub myGraph(ByVal sender As Object, ByVal e As GTA.GraphicsEventArgs) Handles MyBase.PerFrameDrawing
- e.graphics.DrawLine(10, 10, 100, 10, 10.0, System.Drawing.Color.white)
- e.graphics.DrawRectangle(50, 50, 50, 50, System.Drawing.Color.red)
- e.graphics.DrawText(myKeyPressed.tostring, 200, 10, System.Drawing.Color.yellow, myFont)
- if exists(player.character.currentvehicle) andalso exists(mySpeedoBack) andalso exists(mySpeedoArrow) then
- e.graphics.DrawSprite(mySpeedoBack, 150, 300, 300, 300, 0, System.Drawing.Color.white)
- e.graphics.DrawSprite(mySpeedoArrow, 150, 315, 300, 300, (player.character.currentvehicle.speed * 3) * (3.1415 / 180), System.Drawing.Color.white)
- e.graphics.DrawText(player.character.currentvehicle.speed.tostring, 10, 200)
- '0 mph = 0º
- '15 mph = 45º
- '30 mph = 90º
- '45 mph = 135º
- '60 mph = 180º
- end if
- 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