Quantcast

Jump to content

» «
Photo

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

41 replies to this topic
UltraNineNine
  • UltraNineNine

    Nothing Is Really Over Until The Moment You Stop Trying

  • Members
  • Joined: 13 Mar 2014
  • None

#1

Posted 12 June 2014 - 11:39 PM Edited by UltraNineNine, 22 June 2014 - 04:08 PM.

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 System
Imports GTA
Imports System.Windows.Forms
Imports System.Drawing
Imports System.IO

Public 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("[email protected]")
        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 Sub
End 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("[email protected]");
		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)
	{
	}
}
  • WEISHENCHENG99 likes this

InfamousSabre
  • InfamousSabre

    Harpocrates

  • Members
  • Joined: 03 Jan 2013

#2

Posted 13 June 2014 - 02:13 AM

Good luck detecting lights. If you figure out how, let me know


Jitnaught
  • Jitnaught

    ✰✰✰✰✰✰

  • Members
  • Joined: 24 Aug 2013
  • United-States

#3

Posted 13 June 2014 - 02:19 AM

 

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 System
Imports GTA
Imports System.Windows.Forms
Imports System.Drawing

Public 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 Sub
End 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.


Jitnaught
  • Jitnaught

    ✰✰✰✰✰✰

  • Members
  • Joined: 24 Aug 2013
  • United-States

#4

Posted 13 June 2014 - 02:26 AM

 

 

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 System
Imports GTA
Imports System.Windows.Forms
Imports System.Drawing

Public 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 Sub
End 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.


Rugz007
  • Rugz007

    A simple guy

  • Members
  • Joined: 19 Apr 2014
  • India

#5

Posted 13 June 2014 - 02:48 AM

very hard mod but best of luck


Jitnaught
  • Jitnaught

    ✰✰✰✰✰✰

  • Members
  • Joined: 24 Aug 2013
  • United-States

#6

Posted 13 June 2014 - 02:56 AM

very hard mod but best of luck

 

Detecting lights: yes, difficult. Drawing the lines and destroying the lights: not as difficult


Rugz007
  • Rugz007

    A simple guy

  • Members
  • Joined: 19 Apr 2014
  • India

#7

Posted 13 June 2014 - 03:03 AM

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?"


UltraNineNine
  • UltraNineNine

    Nothing Is Really Over Until The Moment You Stop Trying

  • Members
  • Joined: 13 Mar 2014
  • None

#8

Posted 13 June 2014 - 03:05 AM

 

 

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 System
Imports GTA
Imports System.Windows.Forms
Imports System.Drawing

Public 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 Sub
End 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:

  • WEISHENCHENG99 likes this

Jitnaught
  • Jitnaught

    ✰✰✰✰✰✰

  • Members
  • Joined: 24 Aug 2013
  • United-States

#9

Posted 13 June 2014 - 03:08 AM

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 System
Imports GTA
Imports System.Windows.Forms
Imports System.Drawing

Public 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 Sub
End 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).


Rugz007
  • Rugz007

    A simple guy

  • Members
  • Joined: 19 Apr 2014
  • India

#10

Posted 13 June 2014 - 03:09 AM

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


UltraNineNine
  • UltraNineNine

    Nothing Is Really Over Until The Moment You Stop Trying

  • Members
  • Joined: 13 Mar 2014
  • None

#11

Posted 13 June 2014 - 03:13 AM

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:

  • WEISHENCHENG99 likes this

Rugz007
  • Rugz007

    A simple guy

  • Members
  • Joined: 19 Apr 2014
  • India

#12

Posted 13 June 2014 - 03:14 AM

okay okay :( 


Jitnaught
  • Jitnaught

    ✰✰✰✰✰✰

  • Members
  • Joined: 24 Aug 2013
  • United-States

#13

Posted 13 June 2014 - 03:18 AM

 

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).


Rugz007
  • Rugz007

    A simple guy

  • Members
  • Joined: 19 Apr 2014
  • India

#14

Posted 13 June 2014 - 03:19 AM

okay okay i will see to that :D 


UltraNineNine
  • UltraNineNine

    Nothing Is Really Over Until The Moment You Stop Trying

  • Members
  • Joined: 13 Mar 2014
  • None

#15

Posted 13 June 2014 - 03:24 AM Edited by UltraNineNine, 13 June 2014 - 03:27 AM.

 

 

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

  • WEISHENCHENG99 likes this

Rugz007
  • Rugz007

    A simple guy

  • Members
  • Joined: 19 Apr 2014
  • India

#16

Posted 13 June 2014 - 03:53 AM

okay ;)


Rugz007
  • Rugz007

    A simple guy

  • Members
  • Joined: 19 Apr 2014
  • India

#17

Posted 13 June 2014 - 04:17 AM

Relase Date?


Aniton
  • Aniton

    Player Hater

  • Members
  • Joined: 13 May 2014
  • India

#18

Posted 13 June 2014 - 04:29 AM

Relase Date?

let him finish his mod first 

  • line v and Wiebrendh like this

Rugz007
  • Rugz007

    A simple guy

  • Members
  • Joined: 19 Apr 2014
  • India

#19

Posted 13 June 2014 - 04:33 AM

Lol Antion You Are Back


UltraNineNine
  • UltraNineNine

    Nothing Is Really Over Until The Moment You Stop Trying

  • Members
  • Joined: 13 Mar 2014
  • None

#20

Posted 13 June 2014 - 04:38 AM

Relase Date?

Relax man this mod is very hard (unless someone who want to work with me)

  • WEISHENCHENG99 and Wiebrendh like this

InfamousSabre
  • InfamousSabre

    Harpocrates

  • Members
  • Joined: 03 Jan 2013

#21

Posted 13 June 2014 - 05:22 AM Edited by InfamousSabre, 13 June 2014 - 06:54 AM.

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.


UltraNineNine
  • UltraNineNine

    Nothing Is Really Over Until The Moment You Stop Trying

  • Members
  • Joined: 13 Mar 2014
  • None

#22

Posted 13 June 2014 - 06:59 AM

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 ^^

  • WEISHENCHENG99 likes this

InfamousSabre
  • InfamousSabre

    Harpocrates

  • Members
  • Joined: 03 Jan 2013

#23

Posted 13 June 2014 - 07:00 AM Edited by InfamousSabre, 13 June 2014 - 07:02 AM.

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


UltraNineNine
  • UltraNineNine

    Nothing Is Really Over Until The Moment You Stop Trying

  • Members
  • Joined: 13 Mar 2014
  • None

#24

Posted 13 June 2014 - 07:07 AM Edited by UltraNineNine, 13 June 2014 - 07:08 AM.

 

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

  • WEISHENCHENG99 likes this

InfamousSabre
  • InfamousSabre

    Harpocrates

  • Members
  • Joined: 03 Jan 2013

#25

Posted 13 June 2014 - 07:10 AM Edited by InfamousSabre, 13 June 2014 - 08:34 AM.

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.


InfamousSabre
  • InfamousSabre

    Harpocrates

  • Members
  • Joined: 03 Jan 2013

#26

Posted 13 June 2014 - 08:48 AM Edited by InfamousSabre, 13 June 2014 - 09:09 AM.

 

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.


UltraNineNine
  • UltraNineNine

    Nothing Is Really Over Until The Moment You Stop Trying

  • Members
  • Joined: 13 Mar 2014
  • None

#27

Posted 13 June 2014 - 09:34 AM

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
  • WEISHENCHENG99 likes this

InfamousSabre
  • InfamousSabre

    Harpocrates

  • Members
  • Joined: 03 Jan 2013

#28

Posted 13 June 2014 - 10:17 AM Edited by InfamousSabre, 13 June 2014 - 12:50 PM.

 

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 ;)


Maro Hannover
  • Maro Hannover

    Scriptboy

  • BUSTED!
  • Joined: 06 Jan 2014
  • None

#29

Posted 13 June 2014 - 11:16 AM

I wish if you make it c#


Jitnaught
  • Jitnaught

    ✰✰✰✰✰✰

  • Members
  • Joined: 24 Aug 2013
  • United-States

#30

Posted 13 June 2014 - 12:28 PM

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.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users