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
- Public Sub New()
- Me.interval = 10
- 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 = keys.d1) andalso exists(player.character.currentvehicle) then
- for each v as vehicle in world.getvehicles(player.character.position, 6.0)
- if exists(v) andalso (v <> player.character.currentvehicle) then
- if not player.character.currentvehicle.model.isHelicopter then
- native.function.call("ATTACH_CAR_TO_CAR_PHYSICALLY", v, player.character.currentvehicle, false, 0, _
- 0, (player.character.currentvehicle.model.getdimensions.y + 1) * -1, 0.2, _
- 0, 0, 0, _
- 0, 0)
- v.enginehealth = 0
- else
- native.function.call("ATTACH_CAR_TO_CAR_PHYSICALLY", v, player.character.currentvehicle, false, 0, _
- 0, 0, -5.0, _
- 1.0, 1.0, 2.0, _
- 0, 0)
- end if
- exit for
- end if
- next
- end if
- if (e.key = keys.d2) andalso exists(player.character.currentvehicle) then
- for each o as gta.object in world.getallobjects
- if exists(o) andalso (o.position.distanceto(player.character.currentvehicle.position) < 6) andalso not o.isattachedsomewhere then
- native.function.call("ATTACH_OBJECT_TO_CAR_PHYSICALLY", o, player.character.currentvehicle, false, 0, _
- 0, (player.character.currentvehicle.model.getdimensions.y + 1) * -1, 0.2, _
- 0, 0, 0, _
- 0, 0)
- exit for
- end if
- next
- end if
- if e.key = keys.numpad0 then world.createvehicle("MAVERICK", player.character.position.around(4))
- if e.key = keys.d3 then
- dim oAux as gta.object = nothing
- dim o as gta.object
- for c as int16 = 1 to 10
- o = world.createobject("cj_proc_brick", player.character.position.around(1 + c / 2))
- native.function.call("SET_OBJECT_AS_STEALABLE", o, 1)
- if exists(oAux) then
- native.function.call("ATTACH_OBJECT_TO_OBJECT_PHYSICALLY", o, oAux, false, 0, _
- 0.2, 0, 0, _
- 0.05, 0.05, 0.05, _
- 0, 0)
- else
- Native.Function.Call("GIVE_PED_PICKUP_OBJECT", Player.Character, o)
- end if
- oAux = o
- next
- end if
- End Sub
- Private Sub keyUp(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyUp
- end sub
- Private Sub general_tick(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Tick
- 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