Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'TRYING TO MAKE A CAMERA THAT ACTS AS A FIRST FIRST VIEW! MANAGED TO GET IN PLAYER POSITION, BUT NOT RIGHT HEIGHT (WHERE HIS HEAD IS)
- '- WOULD I NEED TO REMOVE HEAD, IF SO, RIG PART VISIBLE = FALSE?
- '
- '
- '
- '
- '
- 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.StreamWriter ' if you want vb application form functions (if that is a fucntion) ???
- Public Class BasicScript2
- Inherits Script
- Private myped As Ped
- Private mycam As Camera
- Public Sub New()
- mycam = New Camera
- Game.DefaultCamera.FOV = 100
- Me.Interval = 10
- End Sub
- Private Sub msg(ByVal sMsg As String, ByVal time As int32)
- Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", sMsg, time, 1)
- End Sub
- Shadows Sub keyDown(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyDown
- If e.Key = Keys.NumPad0 Then
- GTA.Native.Function.Call("APPLY_FORCE_TO_CAR", "Player.Character.CurrentVehicle", True, 5.0, 5.0, 5.0, 180, 0, 0, True, True, True, True)
- myped = World.CreatePed("m_y_vendor", Player.Character.Position.Around(1))
- myped.Metadata.myWhatever = True
- End If
- If e.Key = Keys.NumPad1 Then
- ' first, let me determine a variable to receive the list
- Dim myList As Ped() ' see the diference? the () menas a list not a single ped
- 'now we set the resulkt of the method to it
- myList = World.GetAllPeds() ' see no params needed, good
- ' now,i will use a FOR to see those peds
- For Each P As Ped In myList ' for each P in the myList, look at the as Ped, im declarating a ped there, the P
- ' temporary ped, just for use in the FOR
- ' here we have access to the peds, using the P
- If Exists(P) Then ' to avoid script crash, always check if the object still exists
- ' now we will check for the metadata
- If Exists(P.Metadata.myWhatever) Then
- P.Delete()
- msg("Peds Cleared", 4000)
- ' simple, the metadata was created before, normal peds dont have it
- ' but our ped have
- End If
- End If
- Next
- End If
- If e.Key = Keys.NumPad5 Then
- Dim c As Double = Game.CurrentCamera.FOV
- mycam.Position = Player.Character.Position
- mycam.Rotation = Player.Character.Direction
- mycam.Activate()
- While c > 20
- mycam.FOV = c
- c -= 0.5
- Wait(10)
- End While
- End If
- If e.Key = Keys.NumPad2 Then
- mycam.Deactivate()
- End If
- If e.Key = Keys.L Then
- World.CreateVehicle("turismo", Player.Character.Position.Around(5))
- '(Player.Character.Position, ExplosionType.Rocket, 1000, True, False, 0)
- End If
- End Sub
- Shadows 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
- If Exists(Game.DefaultCamera) Then
- mycam.Rotation = Game.DefaultCamera.Rotation
- Else
- mycam.Rotation = Game.CurrentCamera.Rotation
- End If
- 'Dim camPos As Vector3
- 'camPos = Player.Character.Position
- 'camPos.Z += 0.9
- 'mycam.Position = camPos
- 'mycam.Position = Player.Character.Position + Vector3.WorldUp / 2
- mycam.Position = Player.Character.GetBonePosition(Bone.Head)
- mycam.Position += Player.Character.Direction / 5
- mycam.FOV = 60
- ' same resulkt , diferent ways to use, but, to avoid logical problems, use aways if then end if
- 'ok it just some of your code have the "_" instead and i didnt no why, the underscore mean or "equal"
- ' this _ its a line breaker for code, compiler will treat as a unique line
- 'yep almost but diferent ^^, because here, its vbisual for the program, for the final user didnt change anything
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement