GTA Modification Forums
Simple Script to create parked cars :-( help!
 |
|
 |
| |
Southern_Smoke  |
|
Player Hater

Group: Members
Joined: Jun 18, 2011


|
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?
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
motorsport71  |
Posted: Saturday, May 26 2012, 23:15
|
newbie modder

Group: Members
Joined: Oct 20, 2009

|
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.
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
| |
 |
|
 |
|