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
- 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
- Public Sub New()
- 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
- myped = World.CreatePed("m_y_vendor", Player.Character.Position)
- 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 P.Metadata.myWhatever Then
- P.Delete()
- ' simple, the metadata was created before, normal peds dont have it
- ' but our ped have
- End If
- End If
- Next
- 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
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement