Jump to content

[W.I.P] Police Blackout Escape Inspired By Watch Dogs


Recommended Posts

UltraNineNine

This mod was demanding from a lot of people out there and that's why I'm creating it.You can cause a MASSIVE blackout when being arrested like in Watch Dog.

 

Right now what I need to do is:

1:Disable the hotkey when in vehicle=DONE

2:Making the effect (white line and such)

3:Detect some light around you and disable them=DONE(CREDIT TO INFAMOUSSABRE)

 

Here is the code (VB.Net).If someone want to help me with the project,I am gladly appreciated it ^^.To use this code you need my custom mobile phone and place it in data/maps/props/lev_des/minigame.img using openiv or sparkiv

 

Update:Now when the police is arresting you,niko will take out his phone and then disable the surrounding light,no need for pressing a hotkey again.

Fix the issue phone model is keep in hand even the animation has finished playing

Fix the issue where player will execute the shocked anim too

Obs,the image below is the old one,I will update the image when I have free time to do so.

AuTsIw8.jpg

Imports SystemImports GTAImports System.Windows.FormsImports System.DrawingImports System.IOPublic Class PoliceBlackoutEscape    Inherits Script    Private peds As GTA.Ped    Private v As GTA.Vehicle    Private myObject As GTA.Object    Private myImage As Texture    Private myLine As GTA.GraphicsEventArgs    Public Function Nox(name As [string], obj As GTA.Object, Xx As Double, Yy As Double, Zz As Double) As Boolean        If obj.Model = name Then            Dim noxVectorum As Vector3 = obj.GetOffsetPosition(New Vector3(CSng(Xx), CSng(Yy), CSng(Zz)))            World.AddExplosion(noxVectorum, ExplosionType.Molotov, 1.0F, False, True, 0.0F)            Wait(1)            Return True        End If        Return False    End Function    Public Sub Deluminate()    End Sub    Public Sub New()        Me.Interval = 10        Wait(500)    End Sub    Private Sub msgEx(ByVal smsg As String, ByVal time As Int32)        Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", smsg, time, 1)    End Sub    Private Sub keyDown(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyDown    End Sub    Private Sub general_tick(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Tick        Native.Function.Call("REQUEST_ANIM", "busted")        Dim AnimSet2 As AnimationSet        Dim AnimSet As AnimationSet        Dim AnimName2 As String = ("shock_d")        Dim AnimName As String = ("idle_2_hands_up")        AnimSet2 = New AnimationSet("amb@shock")        AnimSet = New AnimationSet("busted")        If Player.Character.Animation.isPlaying(AnimSet, "idle_2_hands_up") Then            Player.Character.Weapons.Select(Weapon.Unarmed)            If Not Exists(myObject) Then                myObject = World.CreateObject("cj_mobile_2", Player.Character.Position + Player.Character.Direction)                If Exists(myObject) Then                    myObject.NoLongerNeeded()                End If            End If            If Exists(myObject) Then                myObject.AttachToPed(Player.Character, Bone.RightHand, New Vector3(0.2, 0.02, 0.07), New Vector3(0, Helper.DegreeToRadian(49), 0))            Else                msgEx("Error Creating Object", 3000)            End If            For Each obj As GTA.Object In World.GetAllObjects()                If Exists(obj) Then                    If Nox("CJ_NYLAMP1", obj, -1.820636, 0.022315, 6.338437) Then                        Continue For                    End If                    If Nox("CJ_NYLAMP2", obj, -2.172007, 0.12333, 8.012297) Then                        Continue For                    End If                    If Nox("BM_NYlamp1", obj, -2.360577, -0.044513, 9.006103) Then                        Continue For                    End If                    If Nox("BM_NYlamp1_italy", obj, -2.360519, -0.042468, 9.007148) Then                        Continue For                    End If                    If Nox("BM_NYlamp10", obj, 1.105648, -0.02796, 6.95975) Then                        Continue For                    End If                    If Nox("BM_NYlamp3", obj, 0.588022, 0.000094, 6.623109) Then                        Continue For                    End If                    If Nox("BM_NYlamp4", obj, 0.002443, -0.000175, 3.418474) Then                        Continue For                    End If                    If Nox("BM_NYlamp5", obj, 0.0, 0.0, 2.592868) Then                        Continue For                    End If                    If Nox("BM_NYlamp6", obj, -0.002968, 0.906265, 7.074896) Then                        Continue For                    End If                    If Nox("BM_NYlamp6a", obj, 0.000183, -0.991922, 7.074895) Then                        Continue For                    End If                    If Nox("BM_NYlamp6c", obj, 0.003021, 0.906265, 7.074896) Then                        Continue For                    End If                    If Nox("BM_NYlamp7", obj, 0.428986, 0.0, 3.518463) Then                        Continue For                    End If                    If Nox("BM_NYlamp7_c", obj, 0.425209, -0.000858, 3.518463) Then                        Continue For                    End If                    If Nox("BM_NYlamp8a", obj, -0.045185, -0.04813, 4.05437) Then                        Continue For                    End If                    If Nox("BM_NYlamp9", obj, 2.592987, -0.031342, 6.985426) Then                        Continue For                    End If                    If Nox("CJ_DM_LIGHT_1", obj, -0.001099, 0.000611, 1.036494) Then                        Continue For                    End If                    If Nox("BM_wall_light_06", obj, -0.001186, -0.289532, 0.182018) Then                        Continue For                    End If                    If Nox("BM_Fount_Lamp", obj, -0.368591, -0.001694, 1.541134) Then                        Continue For                    End If                    If Nox("BM_NYlamp12", obj, 0.503569, 0.000843, 3.084074) Then                        Continue For                    End If                    If Nox("BM_NYlamp1a", obj, -2.35546, -0.043513, 9.006103) Then                        Continue For                    End If                    If Nox("BM_NYlamp1c", obj, -2.365834, -0.044478, 9.007148) Then                        Continue For                    End If                    If Nox("BM_NYlamp2a", obj, 2.865293, -0.033314, 7.239458) Then                        Continue For                    End If                    Nox("BM_NYlamp110b", obj, -1.150871, -0.021925, 6.95975)                    If Nox("BM_NYlamp110b", obj, 1.106682, -0.021926, 6.959701) Then                        Continue For                    End If                    Nox("CJ_NYLAMP2b", obj, 2.216553, 0.125385, 8.005576)                    If Nox("CJ_NYLAMP2b", obj, -2.176678, 0.123438, 8.007202) Then                        Continue For                    End If                    Nox("BM_NYlamp1b", obj, 1.588559, -0.034787, 7.781668)                    If Nox("BM_NYlamp1b", obj, -1.617659, -0.03474597, 7.781666) Then                        Continue For                    End If                    Nox("BM_NYlamp2b", obj, 2.560533, -0.038488, 7.685022)                    If Nox("BM_NYlamp2b", obj, -2.580149, -0.030655, 7.686369) Then                        Continue For                    End If                    Nox("BM_NYlamp7_b", obj, -0.423843, -0.00064, 3.518462)                    If Nox("BM_NYlamp7_b", obj, 0.426323, -0.000305, 3.518462) Then                        Continue For                    End If                End If            Next            For Each peds As GTA.Ped In World.GetAllPeds                If (Exists(peds) _            AndAlso (peds <> Player.Character)) Then                    peds.Task.ClearAllImmediately()                    peds.Animation.Play(AnimSet2, AnimName2, 8, AnimationFlags.Unknown05 Or AnimationFlags.Unknown06)                End If            Next            If Player.Character.Animation.isPlaying(AnimSet, "idle_2_hands_up") Then            Else                myObject.Delete()            End If        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 SubEnd Class 

For C# User

using Microsoft.VisualBasic;using System;using System.Collections;using System.Collections.Generic;using System.Data;using System.Diagnostics;using GTA;using System.Windows.Forms;using System.Drawing;using System.IO;public class PoliceBlackoutEscape : Script{	private GTA.Ped peds;	private GTA.Vehicle v;	private GTA.Object myObject;	private Texture myImage;	private GTA.GraphicsEventArgs myLine;	public bool Nox(String name, GTA.Object obj, double Xx, double Yy, double Zz)	{		if (obj.Model == name) {			Vector3 noxVectorum = obj.GetOffsetPosition(new Vector3(Convert.ToSingle(Xx), Convert.ToSingle(Yy), Convert.ToSingle(Zz)));			World.AddExplosion(noxVectorum, ExplosionType.Molotov, 1f, false, true, 0f);			Wait(1);			return true;		}		return false;	}	public void Deluminate()	{	}	public PoliceBlackoutEscape()	{		PerFrameDrawing += GraphicsEventHandler;		ConsoleCommand += console_CMD;		Tick += general_tick;		KeyDown += keyDown;		this.Interval = 10;		Wait(500);	}	private void msgEx(string smsg, Int32 time)	{		Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", smsg, time, 1);	}	private void keyDown(object sender, GTA.KeyEventArgs e)	{	}	private void general_tick(object sender, EventArgs e)	{		Native.Function.Call("REQUEST_ANIM", "busted");		AnimationSet AnimSet2 = default(AnimationSet);		AnimationSet AnimSet = default(AnimationSet);		string AnimName2 = ("shock_d");		string AnimName = ("idle_2_hands_up");		AnimSet2 = new AnimationSet("amb@shock");		AnimSet = new AnimationSet("busted");		if (Player.Character.Animation.isPlaying(AnimSet, "idle_2_hands_up")) {			Player.Character.Weapons.Select(Weapon.Unarmed);			if (!Exists(myObject)) {				myObject = World.CreateObject("cj_mobile_2", Player.Character.Position + Player.Character.Direction);				if (Exists(myObject)) {					myObject.NoLongerNeeded();				}			}			if (Exists(myObject)) {				myObject.AttachToPed(Player.Character, Bone.RightHand, new Vector3(0.2, 0.02, 0.07), new Vector3(0, Helper.DegreeToRadian(49), 0));			} else {				msgEx("Error Creating Object", 3000);			}			foreach (GTA.Object obj in World.GetAllObjects()) {				if (Exists(obj)) {					if (Nox("CJ_NYLAMP1", obj, -1.820636, 0.022315, 6.338437)) {						continue;					}					if (Nox("CJ_NYLAMP2", obj, -2.172007, 0.12333, 8.012297)) {						continue;					}					if (Nox("BM_NYlamp1", obj, -2.360577, -0.044513, 9.006103)) {						continue;					}					if (Nox("BM_NYlamp1_italy", obj, -2.360519, -0.042468, 9.007148)) {						continue;					}					if (Nox("BM_NYlamp10", obj, 1.105648, -0.02796, 6.95975)) {						continue;					}					if (Nox("BM_NYlamp3", obj, 0.588022, 9.4E-05, 6.623109)) {						continue;					}					if (Nox("BM_NYlamp4", obj, 0.002443, -0.000175, 3.418474)) {						continue;					}					if (Nox("BM_NYlamp5", obj, 0.0, 0.0, 2.592868)) {						continue;					}					if (Nox("BM_NYlamp6", obj, -0.002968, 0.906265, 7.074896)) {						continue;					}					if (Nox("BM_NYlamp6a", obj, 0.000183, -0.991922, 7.074895)) {						continue;					}					if (Nox("BM_NYlamp6c", obj, 0.003021, 0.906265, 7.074896)) {						continue;					}					if (Nox("BM_NYlamp7", obj, 0.428986, 0.0, 3.518463)) {						continue;					}					if (Nox("BM_NYlamp7_c", obj, 0.425209, -0.000858, 3.518463)) {						continue;					}					if (Nox("BM_NYlamp8a", obj, -0.045185, -0.04813, 4.05437)) {						continue;					}					if (Nox("BM_NYlamp9", obj, 2.592987, -0.031342, 6.985426)) {						continue;					}					if (Nox("CJ_DM_LIGHT_1", obj, -0.001099, 0.000611, 1.036494)) {						continue;					}					if (Nox("BM_wall_light_06", obj, -0.001186, -0.289532, 0.182018)) {						continue;					}					if (Nox("BM_Fount_Lamp", obj, -0.368591, -0.001694, 1.541134)) {						continue;					}					if (Nox("BM_NYlamp12", obj, 0.503569, 0.000843, 3.084074)) {						continue;					}					if (Nox("BM_NYlamp1a", obj, -2.35546, -0.043513, 9.006103)) {						continue;					}					if (Nox("BM_NYlamp1c", obj, -2.365834, -0.044478, 9.007148)) {						continue;					}					if (Nox("BM_NYlamp2a", obj, 2.865293, -0.033314, 7.239458)) {						continue;					}					Nox("BM_NYlamp110b", obj, -1.150871, -0.021925, 6.95975);					if (Nox("BM_NYlamp110b", obj, 1.106682, -0.021926, 6.959701)) {						continue;					}					Nox("CJ_NYLAMP2b", obj, 2.216553, 0.125385, 8.005576);					if (Nox("CJ_NYLAMP2b", obj, -2.176678, 0.123438, 8.007202)) {						continue;					}					Nox("BM_NYlamp1b", obj, 1.588559, -0.034787, 7.781668);					if (Nox("BM_NYlamp1b", obj, -1.617659, -0.03474597, 7.781666)) {						continue;					}					Nox("BM_NYlamp2b", obj, 2.560533, -0.038488, 7.685022);					if (Nox("BM_NYlamp2b", obj, -2.580149, -0.030655, 7.686369)) {						continue;					}					Nox("BM_NYlamp7_b", obj, -0.423843, -0.00064, 3.518462);					if (Nox("BM_NYlamp7_b", obj, 0.426323, -0.000305, 3.518462)) {						continue;					}				}			}			foreach (GTA.Ped peds in World.GetAllPeds) {				if ((Exists(peds) && (peds != Player.Character))) {					peds.Task.ClearAllImmediately();					peds.Animation.Play(AnimSet2, AnimName2, 8, AnimationFlags.Unknown05 | AnimationFlags.Unknown06);				}			}			if (Player.Character.Animation.isPlaying(AnimSet, "idle_2_hands_up")) {			} else {				myObject.Delete();			}		}	}	private void console_CMD(object sender, ConsoleEventArgs e)	{	}	private void GraphicsEventHandler(object sender, GTA.GraphicsEventArgs e)	{	}}
Edited by UltraNineNine
  • Like 1

 

This mod was demanding from a lot of people out there and that's why I'm creating it

 

Right now,the feature is only when you press B,niko will execute the busted anim and take out his phone and if you want to delete the phone model and cancel the anim you can press Backspace

 

Right now what I need to do is:

1:Disable the hotkey when in vehicle

2:Making the effect (white line and such)

3:Detect some light around you and disable them

 

Here is the code (VB.Net).If someone want to help me with the project,I am gladly appreciated it ^^.To use this code you need my custom mobile phone and place it in data/maps/props/lev_des/minigame.img using openiv or sparkiv

Imports SystemImports GTAImports System.Windows.FormsImports System.DrawingPublic Class PoliceBlackoutEscape    Inherits Script    Public Sub New()        Me.Interval = 10        Wait(500)    End Sub    Private myObject As GTA.Object    Private Sub msgEx(ByVal smsg As String, ByVal time As Int32)        Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", smsg, time, 1)    End Sub    Private Sub keyDown(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyDown        If e.Key = Keys.B Then            Player.Character.Weapons.Select(Weapon.Unarmed)            Native.Function.Call("REQUEST_ANIM", "busted")            Player.Character.SayAmbientSpeech("fight")            Dim AnimSet As AnimationSet            Dim AnimName As String = ("idle_2_hands_up")            AnimSet = New AnimationSet("busted")            Player.Character.Animation.Play(AnimSet, AnimName, 8, AnimationFlags.Unknown06)            If Not Exists(myObject) Then                myObject = World.CreateObject("cj_mobile_2", Player.Character.Position + Player.Character.Direction)                If Exists(myObject) Then                    myObject.NoLongerNeeded()                End If            End If            If Exists(myObject) Then                myObject.AttachToPed(Player.Character, Bone.RightHand, New Vector3(0.2, 0.02, 0.07), New Vector3(0, Helper.DegreeToRadian(49), 0))            Else                msgEx("error creating object", 3000)            End If        End If        If e.Key = Keys.Back Then            Player.Character.Task.ClearAllImmediately()            If Exists(myObject) Then                myObject.Delete()            End If        End If    End Sub    Private Sub general_tick(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Tick    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 SubEnd Class

 

1. Use Player.Character.isInVehicle()

 

2. Drawing the lines will require you to get the positions of the lights. There aren't any known ways (that I know of) to detect lights and their coordinates.

 

3. Already told you about the detecting thing. Disabling them, well, if you detect them, you could create something that would break the light.

 

 

This mod was demanding from a lot of people out there and that's why I'm creating it

 

Right now,the feature is only when you press B,niko will execute the busted anim and take out his phone and if you want to delete the phone model and cancel the anim you can press Backspace

 

Right now what I need to do is:

1:Disable the hotkey when in vehicle

2:Making the effect (white line and such)

3:Detect some light around you and disable them

 

Here is the code (VB.Net).If someone want to help me with the project,I am gladly appreciated it ^^.To use this code you need my custom mobile phone and place it in data/maps/props/lev_des/minigame.img using openiv or sparkiv

Imports SystemImports GTAImports System.Windows.FormsImports System.DrawingPublic Class PoliceBlackoutEscape    Inherits Script    Public Sub New()        Me.Interval = 10        Wait(500)    End Sub    Private myObject As GTA.Object    Private Sub msgEx(ByVal smsg As String, ByVal time As Int32)        Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", smsg, time, 1)    End Sub    Private Sub keyDown(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyDown        If e.Key = Keys.B Then            Player.Character.Weapons.Select(Weapon.Unarmed)            Native.Function.Call("REQUEST_ANIM", "busted")            Player.Character.SayAmbientSpeech("fight")            Dim AnimSet As AnimationSet            Dim AnimName As String = ("idle_2_hands_up")            AnimSet = New AnimationSet("busted")            Player.Character.Animation.Play(AnimSet, AnimName, 8, AnimationFlags.Unknown06)            If Not Exists(myObject) Then                myObject = World.CreateObject("cj_mobile_2", Player.Character.Position + Player.Character.Direction)                If Exists(myObject) Then                    myObject.NoLongerNeeded()                End If            End If            If Exists(myObject) Then                myObject.AttachToPed(Player.Character, Bone.RightHand, New Vector3(0.2, 0.02, 0.07), New Vector3(0, Helper.DegreeToRadian(49), 0))            Else                msgEx("error creating object", 3000)            End If        End If        If e.Key = Keys.Back Then            Player.Character.Task.ClearAllImmediately()            If Exists(myObject) Then                myObject.Delete()            End If        End If    End Sub    Private Sub general_tick(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Tick    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 SubEnd Class

 

1. Use Player.Character.isInVehicle()

 

2. Drawing the lines will require you to get the positions of the lights. There aren't any known ways (that I know of) to detect lights and their coordinates.

 

3. Already told you about the detecting thing. Disabling them, well, if you detect them, you could create something that would break the light.

 

 

The only way I see the lights being detected,is if you get the model of a lamp pole, then use the height/width(/maybe rotation) to find out where the light is on the lamp approximately.

UltraNineNine

 

 

This mod was demanding from a lot of people out there and that's why I'm creating it

 

Right now,the feature is only when you press B,niko will execute the busted anim and take out his phone and if you want to delete the phone model and cancel the anim you can press Backspace

 

Right now what I need to do is:

1:Disable the hotkey when in vehicle

2:Making the effect (white line and such)

3:Detect some light around you and disable them

 

Here is the code (VB.Net).If someone want to help me with the project,I am gladly appreciated it ^^.To use this code you need my custom mobile phone and place it in data/maps/props/lev_des/minigame.img using openiv or sparkiv

Imports SystemImports GTAImports System.Windows.FormsImports System.DrawingPublic Class PoliceBlackoutEscape    Inherits Script    Public Sub New()        Me.Interval = 10        Wait(500)    End Sub    Private myObject As GTA.Object    Private Sub msgEx(ByVal smsg As String, ByVal time As Int32)        Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", smsg, time, 1)    End Sub    Private Sub keyDown(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyDown        If e.Key = Keys.B Then            Player.Character.Weapons.Select(Weapon.Unarmed)            Native.Function.Call("REQUEST_ANIM", "busted")            Player.Character.SayAmbientSpeech("fight")            Dim AnimSet As AnimationSet            Dim AnimName As String = ("idle_2_hands_up")            AnimSet = New AnimationSet("busted")            Player.Character.Animation.Play(AnimSet, AnimName, 8, AnimationFlags.Unknown06)            If Not Exists(myObject) Then                myObject = World.CreateObject("cj_mobile_2", Player.Character.Position + Player.Character.Direction)                If Exists(myObject) Then                    myObject.NoLongerNeeded()                End If            End If            If Exists(myObject) Then                myObject.AttachToPed(Player.Character, Bone.RightHand, New Vector3(0.2, 0.02, 0.07), New Vector3(0, Helper.DegreeToRadian(49), 0))            Else                msgEx("error creating object", 3000)            End If        End If        If e.Key = Keys.Back Then            Player.Character.Task.ClearAllImmediately()            If Exists(myObject) Then                myObject.Delete()            End If        End If    End Sub    Private Sub general_tick(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Tick    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 SubEnd Class

 

1. Use Player.Character.isInVehicle()

 

2. Drawing the lines will require you to get the positions of the lights. There aren't any known ways (that I know of) to detect lights and their coordinates.

 

3. Already told you about the detecting thing. Disabling them, well, if you detect them, you could create something that would break the light.

 

Yes thx for the vehicle tip it works,now on to to the next one :lol:

  • Like 1

i Know hehe Guys I want to know i thing i think ultraninenine has made it "When We Are Driving a car how to destroy lights nearby of us?"

 

What exactly are you talking about?

 

 

 

This mod was demanding from a lot of people out there and that's why I'm creating it

 

Right now,the feature is only when you press B,niko will execute the busted anim and take out his phone and if you want to delete the phone model and cancel the anim you can press Backspace

 

Right now what I need to do is:

1:Disable the hotkey when in vehicle

2:Making the effect (white line and such)

3:Detect some light around you and disable them

 

Here is the code (VB.Net).If someone want to help me with the project,I am gladly appreciated it ^^.To use this code you need my custom mobile phone and place it in data/maps/props/lev_des/minigame.img using openiv or sparkiv

Imports SystemImports GTAImports System.Windows.FormsImports System.DrawingPublic Class PoliceBlackoutEscape    Inherits Script    Public Sub New()        Me.Interval = 10        Wait(500)    End Sub    Private myObject As GTA.Object    Private Sub msgEx(ByVal smsg As String, ByVal time As Int32)        Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", smsg, time, 1)    End Sub    Private Sub keyDown(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyDown        If e.Key = Keys.B Then            Player.Character.Weapons.Select(Weapon.Unarmed)            Native.Function.Call("REQUEST_ANIM", "busted")            Player.Character.SayAmbientSpeech("fight")            Dim AnimSet As AnimationSet            Dim AnimName As String = ("idle_2_hands_up")            AnimSet = New AnimationSet("busted")            Player.Character.Animation.Play(AnimSet, AnimName, 8, AnimationFlags.Unknown06)            If Not Exists(myObject) Then                myObject = World.CreateObject("cj_mobile_2", Player.Character.Position + Player.Character.Direction)                If Exists(myObject) Then                    myObject.NoLongerNeeded()                End If            End If            If Exists(myObject) Then                myObject.AttachToPed(Player.Character, Bone.RightHand, New Vector3(0.2, 0.02, 0.07), New Vector3(0, Helper.DegreeToRadian(49), 0))            Else                msgEx("error creating object", 3000)            End If        End If        If e.Key = Keys.Back Then            Player.Character.Task.ClearAllImmediately()            If Exists(myObject) Then                myObject.Delete()            End If        End If    End Sub    Private Sub general_tick(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Tick    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 SubEnd Class

 

1. Use Player.Character.isInVehicle()

 

2. Drawing the lines will require you to get the positions of the lights. There aren't any known ways (that I know of) to detect lights and their coordinates.

 

3. Already told you about the detecting thing. Disabling them, well, if you detect them, you could create something that would break the light.

 

Yes thx for the vehicle tip it works,now on to to the next one :lol:

 

 

Np ;)

Work on the lights positions first, then drawing and all that. That way you don't have to figure out how to draw to position and all that, if you can't even detect the lights (not saying you can't).

UltraNineNine

I am just telling like if we are driving a car okay so when we are driving at night all lights burst off

I'm just making the arrest blackout not something that far off my knowledge :blink:

  • Like 1

 

I am just telling like if we are driving a car okay so when we are driving at night all lights burst off

I'm just making the arrest blackout not something that far off my knowledge :blink:

 

 

Well that would require to detect the time (not so hard), if we are driving (also not so hard), and just where the lights are (difficult).

UltraNineNine

 

 

I am just telling like if we are driving a car okay so when we are driving at night all lights burst off

I'm just making the arrest blackout not something that far off my knowledge :blink:

 

 

Well that would require to detect the time (not so hard), if we are driving (also not so hard), and just where the lights are (difficult)

I will see if i can work on the driving blackout after finishing the arrest one

Edited by UltraNineNine
  • Like 1
InfamousSabre

The mod itself is easy. Finding lights is not.

Please hold while I test something... *Testing...*

Test Complete.

=======================================================================
Result: FAIL

Native: SET_OBJECT_LIGHTS

 

Method:

public void Deluminate()    {        foreach (GTA.Object obj in World.GetAllObjects())        {            GTA.Native.Function.Call("SET_OBJECT_LIGHTS", obj, false);        }    }

Notes: Calling method turns off no lights at night.

Okay, Lets try something different... *Testing...*

Test Complete.

=======================================================================
Result: PASS

 

Method:

public void Deluminate()    {        Game.DisplayText("Deluminate!");        foreach (GTA.Object obj in World.GetAllObjects())        {            if (Exists(obj))            {                if (                (obj.Model == "CJ_NYLAMP1") ||                (obj.Model == "CJ_NYLAMP2") ||                (obj.Model == "CJ_NYLAMP2b") ||                (obj.Model == "BM_NYlamp1") ||                (obj.Model == "BM_NYlamp1_italy") ||                (obj.Model == "BM_NYlamp10") ||                (obj.Model == "BM_NYlamp110b") ||                (obj.Model == "BM_NYlamp12") ||                (obj.Model == "BM_NYlamp1a") ||                (obj.Model == "BM_NYlamp1b") ||                (obj.Model == "BM_NYlamp1c") ||                (obj.Model == "BM_NYlamp2a") ||                (obj.Model == "BM_NYlamp2b") ||                (obj.Model == "BM_NYlamp3") ||                (obj.Model == "BM_NYlamp4") ||                (obj.Model == "BM_NYlamp5") ||                (obj.Model == "BM_NYlamp6") ||                (obj.Model == "BM_NYlamp6a") ||                (obj.Model == "BM_NYlamp6c") ||                (obj.Model == "BM_NYlamp7") ||                (obj.Model == "BM_NYlamp7_b") ||                (obj.Model == "BM_NYlamp7_c") ||                (obj.Model == "BM_NYlamp8a") ||                (obj.Model == "BM_NYlamp9")                )                {                    Game.DisplayText("Gary Busey - \"Hello, Lamp.\" ");                    obj.Detach();                    obj.ApplyForce(Vector3.RelativeLeft * 100);                }            }        }    }

Notes: Some lamps, though having a model that is listed, refuse to be affected by anything. Will have to find a way around that.

Edited by InfamousSabre
UltraNineNine

The mod itself is easy. Finding lights is not.

Please hold while I test something... *Testing...*

 

Test Complete.

=======================================================================

Result: FAIL

 

Native: SET_OBJECT_LIGHTS

 

Method:

public void Deluminate()    {        foreach (GTA.Object obj in World.GetAllObjects())        {            GTA.Native.Function.Call("SET_OBJECT_LIGHTS", obj, false);        }    }

Notes: Calling method turns off no lights at night.

Okay, Lets try something different... *Testing...*

 

Test Complete.

=======================================================================

Result: PASS

 

Method:

public void Deluminate()    {        Game.DisplayText("Deluminate!");        foreach (GTA.Object obj in World.GetAllObjects())        {            if (Exists(obj))            {                if (                (obj.Model == "CJ_NYLAMP1") ||                (obj.Model == "CJ_NYLAMP2") ||                (obj.Model == "CJ_NYLAMP2b") ||                (obj.Model == "BM_NYlamp1") ||                (obj.Model == "BM_NYlamp1_italy") ||                (obj.Model == "BM_NYlamp10") ||                (obj.Model == "BM_NYlamp110b") ||                (obj.Model == "BM_NYlamp12") ||                (obj.Model == "BM_NYlamp1a") ||                (obj.Model == "BM_NYlamp1b") ||                (obj.Model == "BM_NYlamp1c") ||                (obj.Model == "BM_NYlamp2a") ||                (obj.Model == "BM_NYlamp2b") ||                (obj.Model == "BM_NYlamp3") ||                (obj.Model == "BM_NYlamp4") ||                (obj.Model == "BM_NYlamp5") ||                (obj.Model == "BM_NYlamp6") ||                (obj.Model == "BM_NYlamp6a") ||                (obj.Model == "BM_NYlamp6c") ||                (obj.Model == "BM_NYlamp7") ||                (obj.Model == "BM_NYlamp7_b") ||                (obj.Model == "BM_NYlamp7_c") ||                (obj.Model == "BM_NYlamp8a") ||                (obj.Model == "BM_NYlamp9")                )                {                    Game.DisplayText("Gary Busey - \"Hello, Lamp.\" ");                    obj.Detach();                    obj.ApplyForce(Vector3.RelativeLeft * 100);                }            }        }    }

Notes: Some lamps, though having a model that is listed, refuse to be affected by anything. Will have to find a way around that.

Wow biggest help ever in my life,this is making my job more easier ^^

  • Like 1
InfamousSabre

That's the thing I was looking for,thx man.Now what all I need is the lamp pole and some other lamp model

 

Sry, I kept editing my post. It checks model now. all the streetlamps i could find were returned. Verified with pd2blips.

 

 

 

Wow biggest help ever in my life,this is making my job more easier ^^

 

NP. You helped me in the past :3

Edited by InfamousSabre
UltraNineNine

 

That's the thing I was looking for,thx man.Now what all I need is the lamp pole and some other lamp model

 

Sry, I kept editing my post. It checks model now. all the streetlamps i could find were returned. Verified with pd2blips.

 

 

 

Wow biggest help ever in my life,this is making my job more easier ^^

 

NP. You helped me in the past :3

 

Yeah I remember that :colgate: ,anyway is there anything I could do to increase the range of disable light

Edited by UltraNineNine
  • Like 1
InfamousSabre

Yeah I remember that :colgate: ,anyway is there anything I could do to increase the range of disable light

Not that I know of. Im still trying to turn them off without flinging them across the city, lol

And trying to get those other ones to work. the ones that aren't responding to ApplyForce() or anything else

 

 

 

 

This keeps most of them in place, but they end up being deleted after a few seconds.

Also, its worth noting that only the light associated with the streetlamps is truned off. The lamps still appear to be on, they just don't emit light.

public void Deluminate()    {        Game.DisplayText("Deluminate!");        foreach (GTA.Object obj in World.GetAllObjects())        {            if (Exists(obj))            {                if (                (obj.Model == "CJ_NYLAMP1") ||                (obj.Model == "CJ_NYLAMP2") ||                (obj.Model == "CJ_NYLAMP2b") ||                (obj.Model == "BM_NYlamp1") ||                (obj.Model == "BM_NYlamp1_italy") ||                (obj.Model == "BM_NYlamp10") ||                (obj.Model == "BM_NYlamp110b") ||                (obj.Model == "BM_NYlamp12") ||                (obj.Model == "BM_NYlamp1a") ||                (obj.Model == "BM_NYlamp1b") ||                (obj.Model == "BM_NYlamp1c") ||                (obj.Model == "BM_NYlamp2a") ||                (obj.Model == "BM_NYlamp2b") ||                (obj.Model == "BM_NYlamp3") ||                (obj.Model == "BM_NYlamp4") ||                (obj.Model == "BM_NYlamp5") ||                (obj.Model == "BM_NYlamp6") ||                (obj.Model == "BM_NYlamp6a") ||                (obj.Model == "BM_NYlamp6c") ||                (obj.Model == "BM_NYlamp7") ||                (obj.Model == "BM_NYlamp7_b") ||                (obj.Model == "BM_NYlamp7_c") ||                (obj.Model == "BM_NYlamp8a") ||                (obj.Model == "BM_NYlamp9")                )                {                    Game.DisplayText("Gary Busey - \"Hello, Lamp.\" ");                    obj.Detach();                    obj.FreezePosition = false;                    GTA.Native.Function.Call("SET_OBJECT_PROOFS", obj, false, false, false, false, false);                    GTA.Native.Function.Call("SET_OBJECT_INVINCIBLE", obj, false);                    obj.Detach();                    obj.ApplyForce(Vector3.RelativeLeft * 1000);                    obj.FreezePosition = true;                }            }        }    }

These are fragment objects. It would seem that we need to damage the particular fragment of the object that is responsible for producing light. Fragments don't show up separate in World.GetAllObjects() and I see no native or scripthook way of returning or doing anything with an object's fragments other than getting their health.

What we need is a way to get these fragments positions.

Edited by InfamousSabre
InfamousSabre

 

I

I just realize something,while using that code I can see lamp pole is flying around from far distance

Lol yeah... like I said, it keeps most of them in place. one or two still go flying, and the ones that don't will get deleted by the engine.

 

We need a way to get the positions of the light fragments themselves, so they can be damaged without harming the actual pole.

 

 

Edit:

OpenFormats .skel files to the rescue! heheheh....

I've got the solution! gimme a min to get this all typed out.

There is a better way of doing this, I'm sure. but would require some fine tuning on these positions.

Edited by InfamousSabre
UltraNineNine

This will disable the vehicle light too

For Each v As Vehicle In World.GetVehicles(Player.Character.Position, 30)                If Exists(v) Then                    v.EngineRunning = False                End If
  • Like 1
InfamousSabre

 

This will disable the vehicle light too

For Each v As Vehicle In World.GetVehicles(Player.Character.Position, 30)                If Exists(v) Then                    v.EngineRunning = False                End If

try using this native for vehicle lights:

FORCE_ALL_VEHICLE_LIGHTS_OFF(boolean off);

 

 

For streetlamps... use THIS!

    public bool Nox(String name, GTA.Object obj, double Xx, double Yy, double Zz)    {        if (obj.Model == name)        {            Vector3 noxVectorum = obj.GetOffsetPosition(new Vector3((float)Xx, (float)Yy, (float)Zz));            World.AddExplosion(noxVectorum,                ExplosionType.Molotov,                1f, false, true, 0f);            Wait(1);            return true;        }        return false;    }    public void Deluminate()    {        Game.DisplayText("Deluminate!");        foreach (GTA.Object obj in World.GetAllObjects())        {            if (Exists(obj))            {                if(Nox("CJ_NYLAMP1", obj, -1.82063600, 0.02231500, 6.33843700)) { continue; }                if(Nox("CJ_NYLAMP2", obj, -2.17200700, 0.12333000, 8.01229700)) { continue; }                if(Nox("CJ_NYLAMP2b", obj, 2.21655300, 0.12538500, 8.00557600)) { continue; }                if(Nox("BM_NYlamp1", obj, -2.36057700, -0.04451300, 9.00610300)) { continue; }                if(Nox("BM_NYlamp1_italy", obj, -2.36051900, -0.04246800, 9.00714800)) { continue; }                if(Nox("BM_NYlamp10", obj, 1.10564800, -0.02796000, 6.95975000)) { continue; }                if(Nox("BM_NYlamp110b", obj, -1.15087100, -0.02192500, 6.95975000)) { continue; }                if(Nox("BM_NYlamp12", obj, 0.50356900, 0.00084300, 3.08407400)) { continue; }                if(Nox("BM_NYlamp1a", obj, -2.35546000, -0.04351300, 9.00610300)) { continue; }                if(Nox("BM_NYlamp1b", obj, 1.58855900, -0.03478700, 7.78166800)) { continue; }                if(Nox("BM_NYlamp1c", obj, -2.36583400, -0.04447800, 9.00714800)) { continue; }                if(Nox("BM_NYlamp2a", obj, 2.86529300, -0.03331400, 7.23945800)) { continue; }                if(Nox("BM_NYlamp2b", obj, 2.56053300, -0.03848800, 7.68502200)) { continue; }                if(Nox("BM_NYlamp3", obj, 0.58802200, 0.00009400, 6.62310900)) { continue; }                if(Nox("BM_NYlamp4", obj, 0.00244300, -0.00017500, 3.41847400)) { continue; }                if(Nox("BM_NYlamp5", obj, 0.00000000, 0.00000000, 2.59286800)) { continue; }                if(Nox("BM_NYlamp6", obj, -0.00296800, 0.90626500, 7.07489600)) { continue; }                if(Nox("BM_NYlamp6a", obj, 0.00018300, -0.99192200, 7.07489500)) { continue; }                if(Nox("BM_NYlamp6c", obj, 0.00302100, 0.90626500, 7.07489600)) { continue; }                if(Nox("BM_NYlamp7", obj, 0.42898600, 0.00000000, 3.51846300)) { continue; }                if(Nox("BM_NYlamp7_b", obj, -0.42384300, -0.00064000, 3.51846200)) { continue; }                if(Nox("BM_NYlamp7_c", obj, 0.42520900, -0.00085800, 3.51846300)) { continue; }                if(Nox("BM_NYlamp8a", obj, -0.04518500, -0.04813000, 4.05437000)) { continue; }                if(Nox("BM_NYlamp9", obj, 2.59298700, -0.03134200, 6.98542600)) { continue; }                if(Nox("CJ_DM_LIGHT_1", obj, -0.00109900, 0.00061100, 1.03649400)) { continue; }                if(Nox("BM_wall_light_06", obj, -0.00118600, -0.28953200, 0.18201800)) { continue; }                if(Nox("BM_Fount_Lamp", obj, -0.36859100, -0.00169400, 1.54113400)) { continue; }            }        }    }

Took me a bit to get all those values.. lol

 

 

Just played around with it and its pretty cool :D

 

I strongly suggest to read and learn from this code, don't just copy and paste ;)

Edited by InfamousSabre

I wish if you make it c#

 

Are you serious?

 

 

 

 

This will disable the vehicle light too

For Each v As Vehicle In World.GetVehicles(Player.Character.Position, 30)                If Exists(v) Then                    v.EngineRunning = False                End If

try using this native for vehicle lights:

FORCE_ALL_VEHICLE_LIGHTS_OFF(boolean off);

 

 

For streetlamps... use THIS!

    public bool Nox(String name, GTA.Object obj, double Xx, double Yy, double Zz)    {        if (obj.Model == name)        {            Vector3 noxVectorum = obj.GetOffsetPosition(new Vector3((float)Xx, (float)Yy, (float)Zz));            World.AddExplosion(noxVectorum,                ExplosionType.Molotov,                1f, false, true, 0f);            Wait(1);            return true;        }        return false;    }    public void Deluminate()    {        Game.DisplayText("Deluminate!");        foreach (GTA.Object obj in World.GetAllObjects())        {            if (Exists(obj))            {                if(Nox("CJ_NYLAMP1", obj, -1.82063600, 0.02231500, 6.33843700)) { continue; }                if(Nox("CJ_NYLAMP2", obj, -2.17200700, 0.12333000, 8.01229700)) { continue; }                if(Nox("CJ_NYLAMP2b", obj, 2.21655300, 0.12538500, 8.00557600)) { continue; }                if(Nox("BM_NYlamp1", obj, -2.36057700, -0.04451300, 9.00610300)) { continue; }                if(Nox("BM_NYlamp1_italy", obj, -2.36051900, -0.04246800, 9.00714800)) { continue; }                if(Nox("BM_NYlamp10", obj, 1.10564800, -0.02796000, 6.95975000)) { continue; }                if(Nox("BM_NYlamp110b", obj, -1.15087100, -0.02192500, 6.95975000)) { continue; }                if(Nox("BM_NYlamp12", obj, 0.50356900, 0.00084300, 3.08407400)) { continue; }                if(Nox("BM_NYlamp1a", obj, -2.35546000, -0.04351300, 9.00610300)) { continue; }                if(Nox("BM_NYlamp1b", obj, 1.58855900, -0.03478700, 7.78166800)) { continue; }                if(Nox("BM_NYlamp1c", obj, -2.36583400, -0.04447800, 9.00714800)) { continue; }                if(Nox("BM_NYlamp2a", obj, 2.86529300, -0.03331400, 7.23945800)) { continue; }                if(Nox("BM_NYlamp2b", obj, 2.56053300, -0.03848800, 7.68502200)) { continue; }                if(Nox("BM_NYlamp3", obj, 0.58802200, 0.00009400, 6.62310900)) { continue; }                if(Nox("BM_NYlamp4", obj, 0.00244300, -0.00017500, 3.41847400)) { continue; }                if(Nox("BM_NYlamp5", obj, 0.00000000, 0.00000000, 2.59286800)) { continue; }                if(Nox("BM_NYlamp6", obj, -0.00296800, 0.90626500, 7.07489600)) { continue; }                if(Nox("BM_NYlamp6a", obj, 0.00018300, -0.99192200, 7.07489500)) { continue; }                if(Nox("BM_NYlamp6c", obj, 0.00302100, 0.90626500, 7.07489600)) { continue; }                if(Nox("BM_NYlamp7", obj, 0.42898600, 0.00000000, 3.51846300)) { continue; }                if(Nox("BM_NYlamp7_b", obj, -0.42384300, -0.00064000, 3.51846200)) { continue; }                if(Nox("BM_NYlamp7_c", obj, 0.42520900, -0.00085800, 3.51846300)) { continue; }                if(Nox("BM_NYlamp8a", obj, -0.04518500, -0.04813000, 4.05437000)) { continue; }                if(Nox("BM_NYlamp9", obj, 2.59298700, -0.03134200, 6.98542600)) { continue; }                if(Nox("CJ_DM_LIGHT_1", obj, -0.00109900, 0.00061100, 1.03649400)) { continue; }                if(Nox("BM_wall_light_06", obj, -0.00118600, -0.28953200, 0.18201800)) { continue; }                if (Nox("BM_Fount_Lamp", obj, -0.36859100, -0.00169400, 1.54113400)) { continue; }            }        }    }

Took me a bit to get all those values.. lol

 

 

Just played around with it and its pretty cool :D

 

 

I had that idea too ;)

Except for those offset values I was going to use the object height/width to find where the light was about.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 0 User Currently Viewing
    0 members, 0 Anonymous, 0 Guests

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.