Advertisement
LostProphet

Check for poles

Dec 17th, 2011
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.08 KB | None | 0 0
  1. using GTA;
  2.  
  3. namespace Effects
  4. {
  5.     class Test : Script
  6.     {
  7.         private Model[] lamps = { "BM_NYtrafflite_11", "BM_NYtraflite10", "BM_NYtraflite2b", "BM_NYtraflite3a", "BM_NYtraflite3b", "BM_NYtraflite3c", "BM_NYtraflite6c", "BM_NYtraflite6c2", "BM_NYtraflite6d", "BM_NYtraflite6d2", "BM_NYtraflite8" };
  8.  
  9.         public Test()
  10.         {
  11.             this.BindConsoleCommand("CheckPoles", new ConsoleCommandDelegate(this.CheckPoles));
  12.         }
  13.  
  14.         private void CheckPoles(ParameterCollection args)
  15.         {
  16.             Object[] objs = World.GetAllObjects();
  17.  
  18.             foreach (Object obj in objs)
  19.             {
  20.                 foreach (Model mod in this.lamps)
  21.                 {
  22.                     if (obj.Model == mod)
  23.                     {
  24.                         Game.Console.Print("Found traffic light: " + mod);
  25.  
  26.                         //Blip blip = obj.AttachBlip();
  27.                         //blip.Color = BlipColor.Green;
  28.  
  29.                         World.AddExplosion(obj.Position);
  30.                     }
  31.                 }
  32.             }
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement