Advertisement
t3quila

protection.sqf

Feb 12th, 2014
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. //FUNCTIONS
  2. //When player equips hearing protection
  3. wearer_fadeSound = {2 fadeSound 0.25}; //Sound fades out smoothly
  4. wearer_addSound = {2 fadeSound 1}; //Sound fades in smoothly
  5.  
  6. //Detect Rangemaster Cap or Opscore Fast with Active Hearing
  7. //Wearing
  8. hearISProt_true =
  9. {
  10. if ((items player) find "lyn_earplugs" >= 0)
  11. then {_this call wearer_fadeSound};
  12. };
  13. //Not Wearing
  14. hearISProt_false =
  15. {
  16. if ((items player) find "lyn_earplugs" <= 0)
  17. then {_this call wearer_addSound};
  18. };
  19. //Do checking
  20. checkHearProt =
  21. {
  22. _this call hearISProt_true;
  23. _this call hearISProt_false;
  24. };
  25. while {alive player} do {sleep 0.5; _this call checkHearProt};
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement