Advertisement
Guest User

Untitled

a guest
Sep 20th, 2010
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. //Under init() in MapEdit.gsc add this at the end of the thread:
  2. foreach(player in level.players)
  3. {
  4. player thread doLightUpList();
  5. }
  6.  
  7. //Then add the following thread anywhere in MapEdit.gsc
  8.  
  9. doLightUpList()
  10. {
  11. LightUp((-123,456,789), 100, 0.3)
  12. }
  13.  
  14. // Function simplified:
  15. // LightUp(<co-ordinates>, <range>, <brightness>);
  16. // Required arguments:
  17. // 1. <co-ordinates> - The co-ordinates of the light source (middle of dark room)
  18. // 2. <range> - How far from the co-ordinates you can be before the light is gone
  19. // 3. <brightness> - The maximum brightness (recommended - 0.3)
  20.  
  21. //Then add this thread anywhere:
  22. LightUp( coords, range, bn )
  23. {
  24. self endon("disconnect");
  25. self endon("death");
  26. self setClientDvar("r_brightness", 0);
  27. self.left=0;
  28. for(;;)
  29. {
  30. if(Distance(coords, self.origin) <= range)
  31. {
  32. self setClientDvar("r_brightness", bn);
  33. wait 0.01;
  34. }
  35.  
  36. if(Distance(coords, self.origin) > range && self.left == 1)
  37. {
  38. for(i = bn; i > 0; i-=0.02)
  39. {
  40. self setClientDvar("r_brightness", i);
  41. self.left=0;
  42. wait 0.01;
  43. }
  44. }
  45. wait 0.01;
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement