UltraNineNine Posted June 13, 2014 Author Share Posted June 13, 2014 (edited) I wish if you make it c# You could convert my code to c# here:http://converter.telerik.com/ Edited June 16, 2014 by UltraNineNine WEISHENCHENG99 1 Link to comment Share on other sites More sharing options...
UltraNineNine Posted June 13, 2014 Author Share Posted June 13, 2014 (edited) . 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 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 June 16, 2014 by UltraNineNine WEISHENCHENG99 1 Link to comment Share on other sites More sharing options...
Jitnaught Posted June 13, 2014 Share Posted June 13, 2014 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 Link to comment Share on other sites More sharing options...
InfamousSabre Posted June 13, 2014 Share Posted June 13, 2014 (edited) 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 June 13, 2014 by InfamousSabre Link to comment Share on other sites More sharing options...
UltraNineNine Posted June 16, 2014 Author Share Posted June 16, 2014 (edited) 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 June 21, 2014 by UltraNineNine WEISHENCHENG99 1 Link to comment Share on other sites More sharing options...
WEISHENCHENG99 Posted June 22, 2014 Share Posted June 22, 2014 (edited) 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 . Edited June 22, 2014 by WEISHENCHENG99 Link to comment Share on other sites More sharing options...
UltraNineNine Posted June 22, 2014 Author Share Posted June 22, 2014 (edited) 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 . I can do that but I need the shocked animation first Edited June 22, 2014 by UltraNineNine WEISHENCHENG99 1 Link to comment Share on other sites More sharing options...
WEISHENCHENG99 Posted June 22, 2014 Share Posted June 22, 2014 (edited) 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 . 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 June 22, 2014 by WEISHENCHENG99 Link to comment Share on other sites More sharing options...
UltraNineNine Posted June 22, 2014 Author Share Posted June 22, 2014 (edited) 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 June 22, 2014 by UltraNineNine WEISHENCHENG99 1 Link to comment Share on other sites More sharing options...
Noox Posted June 22, 2014 Share Posted June 22, 2014 (edited) 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 June 22, 2014 by Noox Link to comment Share on other sites More sharing options...
UltraNineNine Posted June 22, 2014 Author Share Posted June 22, 2014 (edited) 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 June 22, 2014 by UltraNineNine WEISHENCHENG99 1 Link to comment Share on other sites More sharing options...
Noox Posted June 22, 2014 Share Posted June 22, 2014 No problems! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now