IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
Forum Rules GTA Modification Forums

Post mod/code requests in the Mod Requests topic

Post mod releases in the Mod Showroom

Read the Modding Rules BEFORE posting!

GTAGarage.com
free mod hosting from GTANet, simply login with your GTAForums account details

GTAModding.com
GTANet's modding wiki

GTA Modding Chatroom
provided by irc.gtanet.com (Don't have an IRC client? Click here)


  Reply to this topicStart new topicStart Poll

 Simple Script to create parked cars :-( help!

 
Southern_Smoke  
Posted: Friday, May 25 2012, 09:04
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jun 18, 2011

gr.gif

XXXXX



Hey Guys,

i need your help. I need a simple script, which creates cars.
For example:

1) Admiral, xxx, xx, yyy, yy, zz, zzz, Doorlock=true, Alarm=off
2) Banshee, xxx, xx, yyy, yy, zz, zzz, Doorlock=true, Alarm=off

Only a VB script....can you help me?
PM
  Top
 

 
Southern_Smoke  
Posted: Saturday, May 26 2012, 09:31
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jun 18, 2011

gr.gif

XXXXX



can realy nobody help me???
PM
  Top
 

 
motorsport71  
Posted: Saturday, May 26 2012, 23:15
Quote Post


newbie modder
Group Icon
Group: Members
Joined: Oct 20, 2009

XXXXX



I made this for WhiteMike20052
CODE

Imports System
Imports System.Collections
Imports System.Drawing
Imports System.Windows.Forms
Imports GTA
Public Class RandomDamagedVehicles
  Inherits Script
  Private Son As Boolean = False
  Public Sub New()
      Me.interval = 1000
      BindKey(Settings.GetValueKey("Toggle Script", "SETTINGS", Keys.F7), New KeyPressDelegate(AddressOf ScriptOn))
  End Sub
  Private Function RandomNumber(ByVal min As Integer, ByVal max As Integer) As Integer
      Dim random As New Random()
      Return random.Next(min, max)
  End Function
  Private Sub RandomVehicleDamages_Tick(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Tick
      If son Then
          Dim random As New Random()
          Dim h As Integer = RandomNumber(0, 359)
          Dim vs As Integer = RandomNumber(0, 5)
          Dim vs2 As Integer = RandomNumber(0, 2)
          Dim r As Integer = RandomNumber(0, 2)
          Dim d As Integer = RandomNumber(1, 5)
          Dim hz As Integer = RandomNumber(0, 4)
          Dim n As Integer = RandomNumber(0, 40)
          Dim ez As Integer = RandomNumber(10, 500)


          If vs = 2 Then
              Dim vehicle As vehicle = world.createvehicle(player.character.position.around(30.0F).toground)
              If exists(vehicle) AndAlso vehicle IsNot Nothing Then
                  Vehicle.EngineHealth = ez
                  vehicle.dirtyness = d

                  If vs2 = 0 Then
                      Vehicle.PlaceOnNextStreetProperly()
                      Dim blip As blip = blip.addblip(vehicle)
                      blip.color = blipcolor.grey
                  End If


                  If vs2 = 1 Then
                      vehicle.heading = h
                      Vehicle.PlaceOnGroundProperly()
                      Dim blip As blip = blip.addblip(vehicle)
                      blip.color = blipcolor.purple
                  End If

                  vehicle.nolongerneeded()

                  If r = 1 Then
                      Vehicle.EngineRunning = False
                  End If

                  If hz = 2 Then
                      Vehicle.HazardLightsOn = True
                  End If

                  If n = 2 Then
                      Native.Function.Call("OPEN_CAR_DOOR", vehicle, 0)
                      Native.Function.Call("OPEN_CAR_DOOR", vehicle, 1)
                      Native.Function.Call("OPEN_CAR_DOOR", vehicle, 2)
                      Native.Function.Call("OPEN_CAR_DOOR", vehicle, 3)
                  End If

                  If n = 4 Then
                      Native.Function.Call("OPEN_CAR_DOOR", vehicle, 0)
                      Native.Function.Call("OPEN_CAR_DOOR", vehicle, 2)
                  End If

                  If n = 7 Then
                      Native.Function.Call("OPEN_CAR_DOOR", vehicle, 1)
                      Native.Function.Call("OPEN_CAR_DOOR", vehicle, 3)
                  End If

                  If n = 9 Then
                      Native.Function.Call("BREAK_CAR_DOOR", vehicle, 6)
                  End If

                  If n = 13 Then
                      Native.Function.Call("OPEN_CAR_DOOR", vehicle, 0)
                  End If

                  If n = 16 Then
                      Native.Function.Call("OPEN_CAR_DOOR", vehicle, 5)
                  End If

                  If n = 17 Then
                      Native.Function.Call("BREAK_CAR_DOOR", vehicle, 3)
                  End If

                  If n = 19 Then
                      Native.Function.Call("BREAK_CAR_DOOR", vehicle, 5)
                  End If

                  If n = 21 Then
                      Native.Function.Call("BREAK_CAR_DOOR", vehicle, 2)
                  End If


                  If n = 24 Then
                      Native.Function.Call("BREAK_CAR_DOOR", vehicle, 4)

                  End If

                  If n = 28 Then
                      Native.Function.Call("OPEN_CAR_DOOR", vehicle, 4)
                  End If

                  If n = 32 Then
                      Native.Function.Call("BREAK_CAR_DOOR", vehicle, 1)

                  End If

                  If n = 34 Then
                      Native.Function.Call("OPEN_CAR_DOOR", vehicle, 5)
                  End If

                  If n = 36 Then
                      Native.Function.Call("OPEN_CAR_DOOR", vehicle, 3)
                  End If

                  If n = 37 Then
                      Native.Function.Call("BREAK_CAR_DOOR", vehicle, 2)

                  End If
              End If
          End If
      End If
  End Sub
  Private Sub ScriptOn()
      SON = Not SON
      If SON Then
          Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", "Random Vehicle Placements Activated", 4000, 1)
      Else
          Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", "Random Vehicle Placements Deactivated", 4000, 1)
      End If
  End Sub
End Class

Modify it to your liking. It spawns random vehicles on / off streets in damaged conditions.
PM
  Top
 

 
Southern_Smoke  
Posted: Thursday, May 31 2012, 07:06
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jun 18, 2011

gr.gif

XXXXX



Wow special Thanks man happy.gif happy.gif
PM
  Top
 

 

0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)

0 Members:

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG