Advertisement
TheVideoVolcano

Like my META DATA! BIATCH!

Nov 23rd, 2012
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 2.29 KB | None | 0 0
  1. Imports System ' basic imports
  2. Imports GTA ' basic imports
  3. Imports System.Windows.Forms ' needed to have access to "keys" enumeration, for example
  4. Imports System.Drawing ' needed to handle colors referencing the color name, ex: myCar.color = System.Drawing.Color.Black
  5. Imports System.IO.StreamWriter ' if you want vb application form functions (if that is a fucntion) ???
  6.  
  7. Public Class BasicScript2
  8.     Inherits Script
  9.  
  10.    
  11.     Private myped As Ped
  12.  
  13.  
  14.     Public Sub New()
  15.         Me.Interval = 10
  16.     End Sub
  17.  
  18.     Private Sub msg(ByVal sMsg As String, ByVal time As int32)
  19.         Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", sMsg, time, 1)
  20.     End Sub
  21.  
  22.     Shadows Sub keyDown(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyDown
  23.         If e.Key = Keys.NumPad0 Then
  24.  
  25.             myped = World.CreatePed("m_y_vendor", Player.Character.Position)
  26.             myped.Metadata.myWhatever = True
  27.         End If
  28.  
  29.         If e.Key = Keys.NumPad1 Then
  30.             ' first, let me determine a variable to receive the list
  31.             Dim myList As Ped()  ' see the diference? the () menas a list not a single ped
  32.  
  33.             'now we set the resulkt of the method to it
  34.             myList = World.GetAllPeds() ' see no params needed, good
  35.             ' now,i will use a FOR to see those peds
  36.             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
  37.                 ' temporary ped, just for use in the FOR
  38.                 ' here we have access to the peds, using the P
  39.                 If Exists(P) Then ' to avoid script crash, always check if the object still exists
  40.                     ' now we will check for the metadata
  41.                     If P.Metadata.myWhatever Then
  42.                         P.Delete()
  43.                         ' simple, the metadata was created before, normal peds dont have it
  44.                         ' but our ped have
  45.  
  46.  
  47.                     End If
  48.                 End If
  49.             Next
  50.  
  51.         End If
  52.  
  53.     End Sub
  54.     Shadows Sub keyUp(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyUp
  55.     End Sub
  56.  
  57.     Private Sub general_tick(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Tick
  58.      
  59.     End Sub
  60. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement