Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System
- Imports GTA
- Imports System.Windows.Forms
- Imports System.Drawing
- Imports GTA.Math
- Imports System.Runtime.InteropServices
- Imports System.Text
- Public Class BaseScriptV
- Inherits Script
- Public Shared player As Player = Game.Player
- Public Shared IniFile As String = ".\scripts\MY_INI_FILE.ini"
- Public Sub New()
- AddHandler Tick, AddressOf OnTick
- AddHandler KeyUp, AddressOf OnKeyUp
- AddHandler KeyDown, AddressOf OnKeyDown
- Interval = 10
- End Sub
- Private Sub OnTick(ByVal sender As Object, ByVal e As EventArgs)
- End Sub
- Private Sub OnKeyUp(ByVal sender As Object, ByVal e As KeyEventArgs)
- End Sub
- Private Sub OnKeyDown(ByVal sender As Object, ByVal e As KeyEventArgs)
- Select e.KeyCode
- Case Keys.F6
- 'DO SOMETHING
- Exit Select
- End Select
- End Sub
- Private Function Rand(min As Int32, max As Int32)
- Return New Random().Next(min, max)
- End Function
- Private Shared Function GetTickCount() As Integer
- Return Environment.TickCount()
- End Function
- Public Shared Sub msg(ByVal text As String, Optional ByVal time As Integer = 2500)
- GTA.Native.Function.Call(Native.Hash._SET_TEXT_ENTRY_2, "STRING")
- GTA.Native.Function.Call(Native.Hash._ADD_TEXT_COMPONENT_STRING, text)
- GTA.Native.Function.Call(Native.Hash._0x9D77056A530643F6, time, 1)
- End Sub
- Private Function Exists(ByVal mEntity As Entity) As Boolean
- If Not Native.Function.Call(Of Boolean)(Native.Hash.DOES_ENTITY_EXIST, mEntity) _
- OrElse Not mEntity <> Nothing Then Return False
- Return True
- End Function
- Private Sub SetEntityProofs(mEnt As Entity, bullProof As Boolean, fireProof As Boolean, expProof As Boolean, collisProof As Boolean, meleeProof As Boolean, unk1 As Boolean, unk2 As Boolean, drownProof As Boolean)
- Native.Function.Call(Native.Hash.SET_ENTITY_PROOFS, mEnt, bullProof, fireProof, expProof, collisProof, meleeProof, unk1, unk2, drownProof)
- End Sub
- Private Class TIni
- <DllImport("kernel32.dll", SetLastError:=True)> _
- Private Shared Function GetPrivateProfileString(ByVal lpAppName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As StringBuilder, ByVal nSize As Integer, ByVal lpFileName As String) As Integer
- End Function
- <DllImport("kernel32.dll", SetLastError:=True)> _
- Private Shared Function WritePrivateProfileString(ByVal lpAppName As String, ByVal lpKeyName As String, ByVal lpString As String, ByVal lpFileName As String) As Boolean
- End Function
- Public Shared Function ReadINI(ByVal File As String, ByVal Section As String, ByVal Key As String, ByVal DefaultValue As String) As String
- Dim sb As New StringBuilder(500)
- GetPrivateProfileString(Section, Key, "", sb, sb.Capacity, File)
- If sb.ToString = "" Then WriteINI(File, Section, Key, DefaultValue)
- GetPrivateProfileString(Section, Key, "", sb, sb.Capacity, File)
- Return sb.ToString
- End Function
- Public Shared Sub WriteINI(ByVal File As String, ByVal Section As String, ByVal Key As String, ByVal Value As String)
- WritePrivateProfileString(Section, Key, Value, File)
- End Sub
- End Class
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement