Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'By THEVIDEOVOLCANO/RGSOFTWARE
- Imports GTA, GTA.Math
- Imports System.Drawing
- Public Class TCheckpoint
- Private checkp As Int32 = 0
- Private g_pos As Vector3 = Vector3.Zero
- Private g_height As Vector3 = New Vector3(2.5, 2.5, 2.5)
- Private g_checkType As Int32 = 0
- Private g_radius As Single = 0
- Private g_red As Int32 = 0
- Private g_green As Int32 = 0
- Private g_blue As Int32 = 0
- Private g_alpha As Int32 = 0
- Private g_unknown As Int32 = 0
- Private g_alignwithgnd As Boolean = False
- Public Overloads Sub Create(ByVal checkType As TCheckpoint.CheckType, ByVal position As Vector3, ByVal radius As Single, ByVal red As Int32, ByVal green As Int32, ByVal blue As Int32, ByVal alpha As Int32, ByVal AlignWithGround As Boolean, Optional ByVal unknown As Int32 = 0)
- If Handle() <> 0 Then Delete()
- If AlignWithGround Then position = New Vector3(position.X, position.Y, position.Z - 1)
- checkp = Native.Function.Call(Of Int32)(Native.Hash.CREATE_CHECKPOINT, checkType, position.X, position.Y, position.Z, position.X, position.Y, position.Z, radius, red, green, blue, alpha, unknown)
- g_checkType = checkType
- g_pos = position
- g_radius = radius
- g_red = red
- g_green = green
- g_blue = blue
- g_alpha = alpha
- g_unknown = unknown
- g_alignwithgnd = AlignWithGround
- End Sub
- Public Overloads Sub Create(ByVal checkType As TCheckpoint.CheckType, ByVal posX As Single, ByVal posY As Single, ByVal posZ As Single, ByVal radius As Single, ByVal red As Int32, ByVal green As Int32, ByVal blue As Int32, ByVal alpha As Int32, ByVal AlignWithGround As Boolean, Optional ByVal unknown As Int32 = 0)
- Create(checkType, New Vector3(posX, posY, posZ), radius, red, green, blue, alpha, AlignWithGround, unknown)
- End Sub
- Public Overloads Sub Create(ByVal checkType As TCheckpoint.CheckType, ByVal posX As Single, ByVal posY As Single, ByVal posZ As Single, ByVal radius As Single, ByVal color As Color, ByVal alpha As Int32, ByVal AlignWithGround As Boolean, Optional ByVal unknown As Int32 = 0)
- Create(checkType, New Vector3(posX, posY, posZ), radius, color.R, color.G, color.B, alpha, AlignWithGround, unknown)
- End Sub
- Public Overloads Sub Create(ByVal checkType As TCheckpoint.CheckType, ByVal position As Vector3, ByVal radius As Single, ByVal color As Color, ByVal alpha As Int32, ByVal AlignWithGround As Boolean, Optional ByVal unknown As Int32 = 0)
- Create(checkType, position, radius, color.R, color.G, color.B, alpha, AlignWithGround, unknown)
- End Sub
- Public Sub Delete()
- Native.Function.Call(Native.Hash.DELETE_CHECKPOINT, Handle())
- checkp = 0
- End Sub
- Public Function isCylinder() As Boolean
- Dim match As Int16() = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 21, 22, 24, 28, 42, 45} 'Checkpoints, of type Cylinder
- Return match.Contains(g_checkType)
- End Function
- Public ReadOnly Property Exists() As Boolean
- Get
- Return checkp <> 0
- End Get
- End Property
- Public Enum CheckType
- CylinderSingleArrow = 0
- CylinderDoubleArrow = 1
- CylinderTripleArrow = 2
- CylinderCycleArrow = 3
- CylinderChecker = 4
- CyclinderFadeSingleArrow = 5
- CyclinderFadeDoubleArrow = 6
- CylinderFadeTripleArrow = 7
- CyclinderFadeCycleArrow = 8
- CylinderSmallLowChecker = 9
- ArrowInCircle = 10
- DoubleArrowInCircle = 11
- TripleArrowInCircle = 12
- CycleArrowInCircle = 13
- CheckerInCircle = 14
- Arrow = 15
- DoubleArrow2 = 16
- DoubleArrow3 = 17
- CycleArrow2 = 18
- CheckerFinish = 19
- CylinderArrowLeft = 20
- CylinderDoubleLeftArrow = 21
- CylinderTripleLeftArrow = 22
- CylinderHightChecker = 24
- CylinderHighCycleArrow = 28
- PlaneLeftRollInCircle = 36
- PlaneRightRollInCircle = 36
- PlaneForwardInCircle = 36
- CircleBankLeft = 40
- CylinderZero = 42
- Cylinder = 45
- End Enum
- Public ReadOnly Property Handle() As Int32
- Get
- Return checkp
- End Get
- End Property
- Private Sub setPos(ByVal newPos As Vector3)
- If Exists() Then
- Create(g_checkType, newPos, g_radius, g_red, g_green, g_blue, g_alpha, g_alignwithgnd, g_unknown)
- Height(g_height.X, g_height.Y, g_height.Z)
- End If
- End Sub
- Public Property Position() As Vector3
- Get
- Return g_pos
- End Get
- Set(value As Vector3)
- setPos(value)
- End Set
- End Property
- Private Sub setRadius(ByVal newRadius As Single)
- If Exists() Then
- Create(g_checkType, g_pos, newRadius, g_red, g_green, g_blue, g_alpha, g_alignwithgnd, g_unknown)
- Height(g_height.X, g_height.Y, g_height.Z)
- End If
- End Sub
- Public Property Radius() As Single
- Get
- Return g_radius
- End Get
- Set(value As Single)
- setRadius(value)
- End Set
- End Property
- Public Sub Height(ByVal X As Single, ByVal Y As Single, ByVal Z As Single)
- If Exists() AndAlso isCylinder() Then
- Native.Function.Call(Native.Hash.SET_CHECKPOINT_CYLINDER_HEIGHT, Handle(), X, Y, Z)
- g_height = New Vector3(X, Y, Z)
- End If
- End Sub
- Public Overloads Sub Color(ByVal Red As Int32, ByVal Green As Int32, ByVal Blue As Int32, ByVal Alpha As Int32)
- If Exists() Then
- Native.Function.Call(Native.Hash.SET_CHECKPOINT_RGBA, Handle(), Red, Green, Blue, Alpha)
- g_red = Red
- g_green = Green
- g_blue = Blue
- End If
- End Sub
- Public Overloads Sub Color(ByVal Colour As Color, Optional Alpha As Int32 = 255)
- Color(Colour.R, Colour.G, Colour.B, Alpha)
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement