Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'http://gtaxscripting.blogspot.com/
- 'http://www.facebook.com/GtaIVScripting
- 'https://www.youtube.com/user/GTAScripting
- Imports System
- Imports GTA
- Imports System.Drawing
- Imports System.Windows.Forms
- Public Class fill_cars_sample
- Inherits Script
- Private BSOn As Boolean = False
- Private TRandom As Random = New Random()
- Private Class myPeds
- Public p As Ped = Nothing
- End Class
- Private myPedsList As New List(Of myPeds)
- Private tmpMyPed As myPeds = Nothing
- Public Sub New()
- Me.Interval = 2000
- End Sub
- Shadows Sub keyDown(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyDown
- If e.Key = Keys.NumPad0 Then
- BSOn = Not BSOn
- If BSOn Then
- msg("Script ON...", 3000)
- Else
- msg("Script OFF...", 3000)
- End If
- 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 BSOn Then
- Dim tmpPed As Ped = Nothing
- For Each v As Vehicle In World.GetVehicles(Player.Character.Position, 100)
- If Exists(v) _
- AndAlso (v <> Player.Character.CurrentVehicle) _
- AndAlso (v.EngineRunning OrElse v.Model.isBoat OrElse v.Model.isHelicopter) _
- AndAlso Not v.Metadata.isFilled _
- AndAlso (v.Position.DistanceTo(Player.Character.Position) > 50) Then
- tmpPed = v.GetPedOnSeat(VehicleSeat.Driver)
- If Exists(tmpPed) AndAlso (TRandom.Next(1, 100) Mod 2 = 0) AndAlso (tmpPed.PedType <> PedType.Cop) AndAlso (tmpPed.PedType <> PedType.Fireman) AndAlso (tmpPed.PedType <> PedType.Paramedic) Then
- v.Metadata.isFilled = True
- While v.GetFreePassengerSeat() <> VehicleSeat.None
- Try
- tmpPed = v.CreatePedOnSeat(v.GetFreePassengerSeat)
- If Exists(tmpPed) Then
- tmpPed.Task.ClearAll()
- tmpPed.Task.CruiseWithVehicle(v, v.Speed, True)
- 'tmpPed.AttachBlip()
- tmpMyPed = New myPeds
- tmpMyPed.p = tmpPed
- myPedsList.Add(tmpMyPed)
- End If
- Catch
- End Try
- End While
- End If
- End If
- Next
- Try
- For c As Int16 = myPedsList.Count - 1 To 0 Step -1
- If Exists(myPedsList(c).p) AndAlso (myPedsList(c).p.Position.DistanceTo(Player.Character.Position) > 300) Then
- myPedsList(c).p.Delete()
- myPedsList.RemoveAt(c)
- End If
- Next
- Catch
- End Try
- End If
- End Sub
- Private Sub console_CMD(ByVal sender As Object, ByVal e As ConsoleEventArgs) Handles MyBase.ConsoleCommand
- End Sub
- Private Sub GraphicsEventHandler(ByVal sender As Object, ByVal e As GTA.GraphicsEventArgs) Handles MyBase.PerFrameDrawing
- 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
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement