Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---------------------------------------------------------------------------
- -- Rain on Clothes by Daemonion
- -- Thanks to EvanTheUseless, Decane and NatVac
- function rain_on_clothes()
- local actor = db.actor
- local rain_fps_l = xr_sound.get_safe_sound_object ("daemonion\\misc\\rain_test_l")
- local rain_fps_r = xr_sound.get_safe_sound_object ("daemonion\\misc\\rain_test_r")
- if not has_alife_info("interior_whitenoise_playing") and level.rain_factor() > 0.03 then
- -- c_print("it is raining; player is outside restrictor")
- if rain_fps_l:playing() == false and rain_fps_r:playing() == false then
- -- c_print("playing sounds")
- rain_fps_l:play_at_pos (actor, vector():set(-5, 0, 1), 0, sound_object.s2d)
- rain_fps_r:play_at_pos (actor, vector():set(5, 0, 1), 0, sound_object.s2d)
- end
- elseif level.rain_factor == 0 then
- -- c_print("not raining; stopping")
- rain_fps_l:stop()
- rain_fps_r:stop()
- elseif has_alife_info("interior_whitenoise_playing") then
- -- c_print("player indoors; audio stopped")
- rain_fps_l:stop()
- rain_fps_r:stop()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement