Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. Gameplay
      2. Missions
      3. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Arena War
      2. After Hours
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA Next

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

Sign in to follow this  
UltraNineNine

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

Recommended Posts

UltraNineNine

I wish if you make it c#

You could convert my code to c# here:http://converter.telerik.com/

 

Edited by UltraNineNine

Share this post


Link to post
Share on other sites
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
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 ;)

That's my way of learning scripting man :)

Edited by UltraNineNine

Share this post


Link to post
Share on other sites
Jitnaught

 

I wish if you make it c#

. You could convert my code to c# here:http://converter.telerik.com/

 

 

 

Oh... I thought he wanted Infamous's code to be in C#, which already is

Share this post


Link to post
Share on other sites
InfamousSabre

Updated a bit for dual lamped street lights. I noticed some weren't turning off. Those same ones though, seem to have an invincible glass on one side. Weird. The light still goes off though.

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("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_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_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; }                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_NYlamp1c", obj, -2.36583400, -0.04447800, 9.00714800)) { continue; }                if (Nox("BM_NYlamp2a", obj, 2.86529300, -0.03331400, 7.23945800)) { continue; }                Nox("BM_NYlamp110b", obj, -1.15087100, -0.02192500, 6.95975000);                if (Nox("BM_NYlamp110b", obj, 1.10668200, -0.02192600, 6.95970100)) { continue; }                Nox("CJ_NYLAMP2b", obj, 2.21655300, 0.12538500, 8.00557600);                if (Nox("CJ_NYLAMP2b", obj, -2.17667800, 0.12343800, 8.00720200)) { continue; }                Nox("BM_NYlamp1b", obj, 1.58855900, -0.03478700, 7.78166800);                if (Nox("BM_NYlamp1b", obj, -1.61765900, -0.03474597, 7.78166600)) { continue; }                Nox("BM_NYlamp2b", obj, 2.56053300, -0.03848800, 7.68502200);                if (Nox("BM_NYlamp2b", obj, -2.58014900, -0.03065500, 7.68636900)) { continue; }                Nox("BM_NYlamp7_b", obj, -0.42384300, -0.00064000, 3.51846200);                if (Nox("BM_NYlamp7_b", obj, 0.42632300, -0.00030500, 3.51846200)) { continue; }            }        }    }
Edited by InfamousSabre

Share this post


Link to post
Share on other sites
UltraNineNine

 

Updated a bit for dual lamped street lights. I noticed some weren't turning off. Those same ones though, seem to have an invincible glass on one side. Weird. The light still goes off though.

 

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("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_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_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; }                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_NYlamp1c", obj, -2.36583400, -0.04447800, 9.00714800)) { continue; }                if (Nox("BM_NYlamp2a", obj, 2.86529300, -0.03331400, 7.23945800)) { continue; }                Nox("BM_NYlamp110b", obj, -1.15087100, -0.02192500, 6.95975000);                if (Nox("BM_NYlamp110b", obj, 1.10668200, -0.02192600, 6.95970100)) { continue; }                Nox("CJ_NYLAMP2b", obj, 2.21655300, 0.12538500, 8.00557600);                if (Nox("CJ_NYLAMP2b", obj, -2.17667800, 0.12343800, 8.00720200)) { continue; }                Nox("BM_NYlamp1b", obj, 1.58855900, -0.03478700, 7.78166800);                if (Nox("BM_NYlamp1b", obj, -1.61765900, -0.03474597, 7.78166600)) { continue; }                Nox("BM_NYlamp2b", obj, 2.56053300, -0.03848800, 7.68502200);                if (Nox("BM_NYlamp2b", obj, -2.58014900, -0.03065500, 7.68636900)) { continue; }                Nox("BM_NYlamp7_b", obj, -0.42384300, -0.00064000, 3.51846200);                if (Nox("BM_NYlamp7_b", obj, 0.42632300, -0.00030500, 3.51846200)) { continue; }            }        }    }

Good job Infamous you help me a lot,I have updated the source code at the first page and convert my code to C#,now I'm making the white line effect from this video:

should't be difficult :) Edited by UltraNineNine

Share this post


Link to post
Share on other sites
WEISHENCHENG99

Wow this script is awesome,I play around with it and it's cool. Although,Can you make the police that is arresting the player look shocked when the light is turning off. That will improve the AI system :lol: .

Edited by WEISHENCHENG99

Share this post


Link to post
Share on other sites
UltraNineNine

Wow this script is awesome,I play around with it and it's cool. Although,Can you make the police that is arresting the player look shocked when the light is turning off. That will improve the AI system :lol: .

I can do that but I need the shocked animation first :)

Edited by UltraNineNine

Share this post


Link to post
Share on other sites
WEISHENCHENG99

 

Wow this script is awesome,I play around with it and it's cool. Although,Can you make the police that is arresting the player look shocked when the light is turning off. That will improve the AI system :lol: .

I can do that but I need the shocked animation first :)

I already found it,use this:

Private peds As GTA.PedDim AnimSet2 As AnimationSetDim AnimName2 As String = ("shock_d")AnimSet2 = New AnimationSet("[email protected]")For Each peds As GTA.Ped In World.GetAllPeds                If Exists(peds) Then                    peds.Animation.Play(AnimSet2, AnimName2, 8, AnimationFlags.Unknown05 Or AnimationFlags.Unknown06)                End If            Next

The AnimationFlags.Unknown05 represents loop animation while AnimationFlags.Unknown06 represents to stop the ped in the last animation position

The anim are not the best but if you find the other anim then feel free to change it

Edited by WEISHENCHENG99

Share this post


Link to post
Share on other sites
UltraNineNine

I already found it,use this:

Private peds As GTA.PedDim AnimSet2 As AnimationSetDim AnimName2 As String = ("shock_d")AnimSet2 = New AnimationSet("[email protected]")For Each peds As GTA.Ped In World.GetAllPeds                If Exists(peds) Then                    peds.Animation.Play(AnimSet2, AnimName2, 8, AnimationFlags.Unknown05 Or AnimationFlags.Unknown06)                End If            Next

The AnimationFlags.Unknown05 represents loop animation while AnimationFlags.Unknown06 represents to stop the ped in the last animation position

The anim are not the best but if you find the other anim then feel free to change it

 

It seem that your method make the player execute the anim too

Edited by UltraNineNine

Share this post


Link to post
Share on other sites
Noox

Not sure how VB works but to avoid that you have to change the condition and I noticed (not sure if I'm wrong here) Niko is always the first ped.

if(Exists(peds) && peds != Player.Character)    //anim
Edited by Noox

Share this post


Link to post
Share on other sites
UltraNineNine

 

Not sure how VB works but to avoid that you have to change the condition and I noticed (not sure if I'm wrong here) Niko is always the first ped.

if(Exists(peds) && peds != Player.Character)    //anim

Thx,I translate your code to VB and set it like this and now player won't be affect with the anim anymore.

 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
Edited by UltraNineNine

Share this post


Link to post
Share on other sites
Noox

No problems!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • 2 Users Currently Viewing
    0 members, 0 Anonymous, 2 Guests

×
×
  • Create New...

Important Information

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