fn_playSound.sqf 525 B

12345678910111213141516171819202122232425262728293031
  1. _sound = [_this,0,"",[""]] call BIS_fnc_param;
  2. _obj = [_this,1,objNull,[objNull]] call BIS_fnc_param;
  3. _radius = 30;
  4. if (isNull _obj) then
  5. {
  6. [
  7. [
  8. [_sound],
  9. { playSound (_this select 0); }
  10. ],
  11. "BIS_fnc_spawn",
  12. true,
  13. false
  14. ] call BIS_fnc_MP;
  15. } else {
  16. {
  17. if ((_x distance _obj) <= _radius) then
  18. {
  19. [
  20. [
  21. [_obj, _sound, _radius],
  22. { (_this select 0) say [(_this select 1), (_this select 2)]; }
  23. ],
  24. "BIS_fnc_spawn",
  25. _x,
  26. false
  27. ] call BIS_fnc_MP;
  28. };
  29. } forEach playableUnits;
  30. };