fn_setRadioChannels.sqf 833 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. _class = (missionConfigFile >> "AW_radio");
  2. _lastIndex = ((count _class) - 1);
  3. if (!isServer) then
  4. {
  5. while { true } do
  6. {
  7. waitUntil { alive player };
  8. {
  9. _canShow = call compile format["%1", (_x select 1)];
  10. if (_canShow) then
  11. {
  12. (_x select 0) radioChannelAdd [player];
  13. };
  14. } foreach radioChannels;
  15. while { alive player } do { sleep 2; };
  16. };
  17. }
  18. else
  19. {
  20. radioChannels = [];
  21. for "_i" from 0 to _lastIndex do
  22. {
  23. _radio = _class select _i;
  24. _ret = radioChannelCreate
  25. [
  26. getArray (_radio >> "colour"),
  27. getText (_radio >> "name"),
  28. getText (_radio >> "prefix"),
  29. []
  30. ];
  31. radioChannels = radioChannels + [[_ret, getText (_radio >> "condition")]];
  32. };
  33. publicVariable "radioChannels";
  34. };
  35. if (!isServer) then
  36. {
  37. "Function ended unexpectedly! Report this to an administrator!" call BIS_fnc_log;
  38. };