When the car reaches my "blind spot" it will try to re-enter the lane, resulting in a collision. The other thing is that (about 40% of the time) the car will approach me from behind, realize I'm stopped (e.g. eventually (if the light is long enough) the car will hit me, resulting in a busted tail light (my damage settings are set pretty sensitive). ![]() Looking back I see the car inch forward then stop every few seconds. If a car approaches me from behind when I'm stopped and stops, it will still try to overtake after a few seconds, but the script tries to prevent it from doing so. Imports SystemImports Microsoft.VisualBasicImports GTAPublic Class HaltBehindScript Inherits Script Private list As New List(Of Vehicle) Private bStopped As Boolean = False Private offset As New Vector3(0.0F, -4.0F, 0.0F) Public Sub New() 'Interval = 250 End Sub Private Sub HaltBehindScript_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Tick Dim v As Vehicle = If v Is Nothing Then If bStopped Then Disable() Return End If If Not bStopped Then If v.Speed >= 1.0F Then Return bStopped = True Else If v.Speed >= 2.0F Then Disable Return End If End If CheckForNewCar(v.GetOffsetPosition(offset)) ProcessCars() End Sub Private Sub Disable() bStopped = False list.Clear() End Sub Private Sub CheckForNewCar(ByVal Position As Vector3) Dim v As Vehicle = World.GetClosestVehicle(Position, 3.0F) If v Is Nothing OrElse list.Contains(v) Then Return list.Add(v) v.SetMetadata("maxspeed", False, v.Speed) End Sub Private Sub ProcessCars() Dim CurrentSpeed As Single Dim MaxSpeed As Single For Each v As Vehicle In list CurrentSpeed = v.Speed MaxSpeed = v.GetMetadata(Of Single)("maxspeed", False) If CurrentSpeed MaxSpeed Then v.Speed = MaxSpeed End If Next End SubEnd Class This script used to work, but some people are saying it doesn't anymore. In vanilla GTA4, if you stop at a red light, NPCs will try to drive around you. ![]() Here is a script that HazardX wrote, which is supposed to stop NPC drivers from trying to overtake you in traffic.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |