Guest User

Untitled

a guest
Aug 25th, 2014
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1. void main(void)
  2. {
  3.     var enabled = 0;
  4.     var lights = GetByType("interior_light");
  5.  
  6.     foreach (lights as light)
  7.     {
  8.         // Save the original settings so we can reset to them later
  9.         var color = light.getColor();
  10.         var radius = light.getRadius();
  11.  
  12.         if (!enabled) // Starting from the Off state, we switch on Red Alert
  13.         {
  14.             // Set them all to red
  15.             light.setColor(255, 0, 0);
  16.            
  17.             // Brighten and dim repeatedly
  18.             while (true)
  19.             {
  20.                 light.setRadius(4);
  21.                 light.setRadius(1);
  22.             }
  23.         }
  24.         else // If it was already on, set it back to defaults
  25.         {
  26.             light.setColor(color);
  27.             light.setRadius(radius);
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment