This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

rain on clothes

By: Daemonion on Feb 18th, 2013  |  syntax: Lua  |  size: 1.07 KB  |  views: 473  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. ---------------------------------------------------------------------------
  2. -- Rain on Clothes by Daemonion
  3. -- Thanks to EvanTheUseless, Decane and NatVac
  4.  
  5. function rain_on_clothes()
  6.         local actor = db.actor
  7.         local rain_fps_l = xr_sound.get_safe_sound_object ("daemonion\\misc\\rain_test_l")
  8.         local rain_fps_r = xr_sound.get_safe_sound_object ("daemonion\\misc\\rain_test_r")
  9.        
  10.         if not has_alife_info("interior_whitenoise_playing") and  level.rain_factor() > 0.03 then
  11.                 -- c_print("it is raining; player is outside restrictor")
  12.                 if rain_fps_l:playing() == false and rain_fps_r:playing() == false then
  13.                         -- c_print("playing sounds")
  14.                         rain_fps_l:play_at_pos (actor, vector():set(-5, 0, 1), 0, sound_object.s2d)
  15.                         rain_fps_r:play_at_pos (actor, vector():set(5, 0, 1), 0, sound_object.s2d)
  16.                 end
  17.         elseif level.rain_factor == 0 then
  18.                 -- c_print("not raining; stopping")
  19.                 rain_fps_l:stop()
  20.                 rain_fps_r:stop()
  21.                
  22.         elseif has_alife_info("interior_whitenoise_playing") then
  23.                 -- c_print("player indoors; audio stopped")
  24.                 rain_fps_l:stop()
  25.                 rain_fps_r:stop()              
  26.         end
  27. end
clone this paste RAW Paste Data