Advertisement
CptAntimate

bla

Apr 25th, 2020
910
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 5.80 KB | None | 0 0
  1. /*
  2.     author: Maxence Lyon
  3.     altis DEV: https://altisdev.com/user/maxence-lyon
  4.     Teamspeak 3: ts.the-programmer.com
  5.     Web site: www.the-programmer.com
  6.     Steam: « Une Vache Sur CS – Maxence », please leave a message on my profile who says the exact reason before adding me.
  7.  
  8.     Terms of use:
  9.         - This file is forbidden unless you have permission from the author. If you have this file without permission to use it please do not use it and do not share it.
  10.         - If you have permission to use this file, you can use it on your server however it is strictly forbidden to share it.
  11.         - Out of respect for the author please do not delete this information.
  12.  
  13.     License number:
  14.     Server's name:
  15.     Owner's name:
  16. */
  17.  
  18.  
  19. _allow = false;
  20. if (player getVariable "CopimDienst") then {_allow = true};
  21. if (player getVariable "MedimDienst") then {_allow = true};
  22. if (player getVariable "AdacimDienst") then {_allow = true};
  23. //if ((getNumber (missionConfigFile >> "Max_Settings_Dispatch" >> "enable_east") isEqualTo 1) && (playerSide isEqualTo east)) then {_allow = true};
  24.  
  25. if !(_allow) exitWith {hint (["STR_ACCES_DENIED","Max_Settings_Dispatch","Dispatch_Localization"] call theprogrammer_core_fnc_localize);};
  26.  
  27. if ((missionNamespace getVariable ["maxence_call_curTask",-1]) isEqualTo -1) then {
  28.     maxence_call_curTask = taskNull;
  29. };
  30.  
  31. createDialog "maxence_call_management";
  32. disableSerialization;
  33.  
  34. _display = findDisplay 6930;
  35. _requestList = _display displayCtrl 6943;
  36. _listPreset = _display displayCtrl 6947;
  37. _assignList = _display displayCtrl 6956;
  38.  
  39. lbClear _requestList;
  40. lbClear _assignList;
  41.  
  42. _texturePath = getText (missionConfigFile >> "Max_Settings_Dispatch" >> "textures_base_path");
  43. _texturePathFormated = _texturePath + "\";
  44. _texture = [_texturePathFormated,[["span class="re5"> fr","span class="re5"> fond_dispatch.paa"],["span class="re5"> en","span class="re5"> fond_dispatch_en.paa"],["span class="re5"> de","span class="re5"> fond_dispatch_de.paa"],["span class="re5"> es","span class="re5"> fond_dispatch_es.paa"]],"span class="re5"> Max_Settings_Dispatch"] call theprogrammer_core_fnc_localizeTexture;
  45. (_display displayCtrl 6931) ctrlSetText _texture;
  46.  
  47. _arrayMessages = getarray (missionConfigFile >> "span class="re5"> Max_Settings_Dispatch" >> "span class="re5"> messages_preset");
  48. {
  49.    _listPreset lbadd ([(_x select 0),"span class="re5"> Max_Settings_Dispatch","span class="re5"> Dispatch_Localization"] call theprogrammer_core_fnc_localize);
  50.    _listPreset lbSetData [(lbSize _listPreset)-1,(_x select 1)];
  51. } forEach ([[(["span class="re5"> STR_CUSTOM_MESSAGE","span class="re5"> Max_Settings_Dispatch","span class="re5"> Dispatch_Localization"] call theprogrammer_core_fnc_localize),""]] + _arrayMessages);
  52.  
  53. _listPreset lbSetCurSel 0;
  54.  
  55. _index = 0;
  56.  
  57. {
  58.    if (!(isNull _x) && (alive _x) && ((side _x) isEqualTo playerSide)) then {
  59.        _assignList lbadd (name _x);
  60.        _assignList lbSetData [(lbSize _assignList)-1,str(_x)];
  61.        if (player isEqualTo _x) then {_index = ((lbSize _assignList)-1);};
  62.    };
  63. } forEach playableUnits;
  64.  
  65. _assignList lbSetCurSel _index;
  66.  
  67. ctrlShow [6953,false];
  68. ctrlEnable [6954,false];
  69. ctrlEnable [6955,false];
  70. ctrlEnable [6942,false];
  71. ctrlShow [6940,false];
  72. ctrlEnable [6946,false];
  73. ctrlEnable [6945,false];
  74. ctrlEnable [6947,false];
  75. ctrlShow [6956,false];
  76.  
  77. _oldVar = [];
  78. _newVar = {[]};
  79. while {!(isNull (findDisplay 6930))} do {
  80.  /*  _newVar = switch (playerSide) do {
  81.        case west : maxence_waiting_cop_calls;
  82.        case independent : maxence_waiting_med_calls;
  83.        case east : {maxence_waiting_east_calls};
  84.        default {[]};
  85.    };
  86. */
  87.  
  88.    if (player getVariable "span class="re5"> CopimDienst") then {
  89.        _newVar = maxence_waiting_cop_calls
  90.    };
  91.    if (player getVariable "span class="re5"> MedimDienst") then  {
  92.        _newVar = maxence_waiting_med_calls;
  93.    };
  94.  
  95.    _newRequests = _newVar - _oldVar;
  96.    _removedRequest = _oldVar - _newVar;
  97.  
  98.    if ((count _newVar) isEqualto 0) then {
  99.        lbClear _requestList;
  100.        _requestList lbadd (["span class="re5"> STR_NO_CALLS","span class="re5"> Max_Settings_Dispatch","span class="re5"> Dispatch_Localization"] call theprogrammer_core_fnc_localize);
  101.        _requestList lbSetData [0,"span class="re5"> NULL"];
  102.  
  103.        {
  104.            (_display displayCtrl _x) ctrlSetText "";
  105.        } forEach [6948,6949,6950,6951,6952];
  106.  
  107.        ctrlEnable [6954,false];
  108.        ctrlEnable [6955,false];
  109.        ctrlEnable [6942,false];
  110.        ctrlShow [6940,false];
  111.    } else {
  112.        {
  113.            _type = switch (_x select 6) do {
  114.                case 0 : {(["span class="re5"> STR_TYPE_MESSAGE","span class="re5"> Max_Settings_Dispatch","span class="re5"> Dispatch_Localization"] call theprogrammer_core_fnc_localize)};
  115.                case 1 : {(["span class="re5"> STR_TYPE_APPEL","span class="re5"> Max_Settings_Dispatch","span class="re5"> Dispatch_Localization"] call theprogrammer_core_fnc_localize)};
  116.                default {"span class="re5"> NULL"};
  117.            };
  118.  
  119.            _text = format ["%1 - %2",(_x select 0),_type];
  120.            _requestList lbadd _text;
  121.  
  122.            if ((_x select 4) isEqualto "") then {
  123.                _requestList lbSetPicture [(lbSize _requestList)-1,format ["%1\not_assigned.paa",_texturePath]];
  124.            } else {
  125.                _requestList lbSetPicture [(lbSize _requestList)-1,format ["%1\assigned.paa",_texturePath]];
  126.            };
  127.        } forEach _newRequests;
  128.  
  129.        {
  130.            _index = -1;
  131.            for "_i" from 0 to (lbSize 6943)-1 do {
  132.                if ((_oldVar select _i) isEqualTo _x) exitWith {_index = _i;};
  133.            };
  134.  
  135.            if !(_index isEqualTo -1) then {
  136.                _requestList lbDelete _index;
  137.  
  138.                if ((lbCurSel 6943) isEqualTo _index) then {
  139.                    {
  140.                        (_display displayCtrl _x) ctrlSetText "";
  141.                    } forEach [6948,6949,6950,6951,6952];
  142.  
  143.                    ctrlEnable [6954,false];
  144.                    ctrlEnable [6955,false];
  145.                    ctrlEnable [6942,false];
  146.                    ctrlShow [6940,false];
  147.                    _requestList lbSetCurSel -1;
  148.                };
  149.            };
  150.        } forEach _removedRequest;
  151.    };
  152.  
  153.    _oldVar = _newVar;
  154.    sleep 3;
  155. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement