Advertisement
Guest User

Untitled

a guest
Mar 15th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 9.22 KB | None | 0 0
  1. span class="re5"> hud_fnc_ui_check = {
  2.     disableSerialization;
  3.     _ui = uiNameSpace getVariable ["playerHUD",displayNull];
  4.     if(isNull _ui) exitWith
  5.     {
  6.         [] call RP_fnc_hudSetup;
  7.         _ui = uiNameSpace getVariable ["playerHUD",displayNull];
  8.         _ui;
  9.     };
  10.     _ui;
  11. };
  12.  
  13. hud_fnc_loop = {
  14.  
  15.     _ui = call hud_fnc_ui_check;
  16.  
  17.     _bleeding = _ui displayCtrl 23570;
  18.     _wounded = _ui displayCtrl 23575;
  19.     _fracture = _ui displayCtrl 23580;
  20.     _unconcious = _ui displayCtrl 23585;
  21.     _disease = _ui displayCtrl 23590;
  22.  
  23.     im_hurt = false;
  24.     _dam = myHealth;
  25.     _dam = round(_dam * 100);
  26.     _dam = round(100 - _dam);
  27.     _injuries = player getVariable ["playerInjuries",[0,0,0,0,0,0,0]];
  28.     if(!im_dead) then
  29.     {
  30.             _injurytext = "";
  31.  
  32.             if( (_injuries select 0) != 0 || (_injuries select 1) != 0 || (_injuries select 7) != 0 ) then {
  33.                 im_hurt = true;
  34.                 _bleeding ctrlSetStructuredText parseText format["<img size='0.07' image='cg_mission_files\icons\head.paa'/><t size='0.03px'> Your head aches. </t>",player];
  35.  
  36.                 _chances = round (random 1000);
  37.                 if(_chances > 985) then
  38.                 {
  39.                     ["Remove",0.01] call fnc_DoHealth;
  40.                 };
  41.  
  42.             }
  43.             else
  44.             {
  45.                 _bleedingon = "";
  46.                 _bleeding ctrlSetText format["%1", _bleedingon];
  47.                 _bleeding ctrlCommit 0;
  48.  
  49.             };
  50.  
  51.  
  52.             if( (_injuries select 2) != 0 || (_injuries select 3) != 0 || (_injuries select 6) != 0 || (_injuries select 9) != 0 ) then {
  53.                 im_hurt = true;
  54.                 _wounded ctrlSetStructuredText parseText format["<img size='0.07' image='cg_mission_files\icons\chest.paa'/><t size='0.03px'> Your body is sore. </t>",player];
  55.  
  56.                 _chances = round (random 1000);
  57.                 if(_chances > 985) then
  58.                 {
  59.                     ["Remove",0.01] call fnc_doHealth;
  60.                 };
  61.  
  62.             }
  63.             else
  64.             {
  65.                 _woundedon = "";
  66.                 _wounded ctrlSetText format["%1", _woundedon];
  67.                 _wounded ctrlCommit 0;
  68.             };
  69.  
  70.  
  71.             if( (_injuries select 4) != 0 || (_injuries select 5) != 0 ) then {
  72.                 im_hurt = true;
  73.                 _fracture ctrlSetStructuredText parseText format["<img size='0.07' image='cg_mission_files\icons\arm.paa'/><t size='0.03px'> Your arms are weak. </t>",player];
  74.  
  75.                 _chances = round (random 1000);
  76.                 if(_chances > 985) then
  77.                 {
  78.                     ["Remove",0.01] call fnc_doHealth;
  79.                 };
  80.  
  81.             }
  82.             else
  83.             {
  84.                 _fractureon = "";
  85.                 _fracture ctrlSetText format["%1", _fractureon];
  86.                 _fracture ctrlCommit 0;
  87.             };
  88.  
  89.  
  90.             if( (_injuries select 8) != 0 ) then {
  91.                 im_hurt = true;
  92.                 _unconcious ctrlSetStructuredText parseText format["<img size='0.07' image='cg_mission_files\icons\foot.paa'/><t size='0.03px'> Your legs are weak. </t>",player];
  93.  
  94.                 _chances = round (random 1000);
  95.                 if(_chances > 985) then
  96.                 {
  97.                     ["Remove",0.01] call fnc_doHealth;
  98.                 };
  99.  
  100.             }
  101.             else
  102.             {
  103.                 _unconciouson = "";
  104.                 _unconcious ctrlSetText format["%1", _unconciouson];
  105.                 _unconcious ctrlCommit 0;
  106.             };
  107.  
  108.  
  109.         if( (_injuries select 10) != 0 ) then
  110.         {
  111.             im_hurt = true;
  112.             _disease ctrlSetStructuredText parseText format["<img size='0.07' image='cg_mission_files\icons\sick.paa'/><t size='0.03px'> You feel sick. </t>",player];
  113.  
  114.  
  115.             _chances = round (random 600);
  116.             if(_chances > 595) then {
  117.                 playSound3D ["cg_sndimg\sounds\cough1.ogg", player, false, getPosASL player, 3, 1, 45];
  118.                 playSound3D ["cg_sndimg\sounds\cough2.ogg", player, false, getPosASL player, 3, 1, 45];
  119.                 [1] spawn RP_fnc_HudElements;
  120.  
  121.             } else {
  122.                 _chances = round (random 1000);
  123.                 if(_chances > 980) then
  124.                 {
  125.                     player enableFatigue true;
  126.                     player setFatigue 0;
  127.                     [1] spawn RP_fnc_HudElements;
  128.                     _coughtype = round (random 4);
  129.                     if(_coughtype == 1) then
  130.                     {
  131.                         playSound3D ["cg_sndimg\sounds\cough1.ogg", player, false, getPosASL player, 3, 1, 45];
  132.                     };
  133.                     if(_coughtype == 2) then
  134.                     {
  135.                         playSound3D ["cg_sndimg\sounds\cough2.ogg", player, false, getPosASL player, 3, 1, 45];
  136.                     };
  137.                     if(_coughtype == 3) then
  138.                     {
  139.                         playSound3D ["cg_sndimg\sounds\cough3.ogg", player, false, getPosASL player, 3, 1, 45];
  140.                     };
  141.                     if(_coughtype == 4) then
  142.                     {
  143.                         playSound3D ["cg_sndimg\sounds\cough4.ogg", player, false, getPosASL player, 3, 1, 45];
  144.                     };
  145.                     if(_chances > 975) then
  146.                     {
  147.                         if(isNull objectParent player) then
  148.                         {
  149.                             [] spawn KK_fnc_forceRagdoll;
  150.                             [] spawn RP_fnc_spreaddisease;
  151.                         };
  152.                     ["Remove",0.05] call fnc_doHealth;
  153.                     };
  154.                 };
  155.             };
  156.         }
  157.         else
  158.         {
  159.             _diseaseon = "";
  160.             _disease ctrlSetText format["%1", _diseaseon];
  161.         };
  162.     };
  163.     if(isNil "RP_fnc_totalPain") exitWith {};
  164.     [] spawn RP_fnc_totalPain;
  165.  
  166.     _food = _ui displayCtrl 1101232;
  167.  
  168.     if (Hunger < 65) then
  169.     {
  170.         if (Hunger > 60) exitWith
  171.         {
  172.             _food ctrlSetStructuredText (parseText format ["<t font = 'PuristaBold' size = '1' align = 'left' color = '#3aa517'>I could do with a snack</t>"]);
  173.         };
  174.         if (Hunger > 40) exitWith
  175.         {
  176.             _food ctrlSetStructuredText (parseText format ["<t font = 'PuristaBold' size = '1' align = 'left' color = '#ff9900'>I should eat</t>"]);
  177.         };
  178.         if (Hunger > 30) exitWith
  179.         {
  180.             _food ctrlSetStructuredText (parseText format ["<t font = 'PuristaBold' size = '1' align = 'left' color = '#ba1616'>Famished</t>"]);
  181.         };
  182.         if (Hunger > 15) exitWith
  183.         {
  184.             _food ctrlSetStructuredText (parseText format ["<t font = 'PuristaBold' size = '1' align = 'left' color = '#ba1616'>Starvation</t>"]);
  185.         };
  186.         if (Hunger < 15) exitWith
  187.         {
  188.             _food ctrlSetStructuredText (parseText format ["<t font = 'PuristaBold' size = '1' align = 'left' color = '#ba1616'>Starvation</t>"]);
  189.         };
  190.     } else {
  191.         _food ctrlSetStructuredText (parseText format ["<t font = 'PuristaBold' size = '1' align = 'left' color = '#3aa517'>Not Hungry</t>"]);
  192.     };
  193.  
  194.     _thirst = _ui displayCtrl 1102;
  195.  
  196.     if (Thirst < 65) then
  197.     {
  198.         if (Thirst > 60) then
  199.         {
  200.             _thirst ctrlSetStructuredText (parseText format ["<t font = 'PuristaBold' size = '1' align = 'left' color = '#3aa517'>I could take a drink</t>"]);
  201.         };
  202.         if (Thirst > 40) exitWith
  203.         {
  204.             _thirst ctrlSetStructuredText (parseText format ["<t font = 'PuristaBold' size = '1' align = 'left' color = '#ff9900'>My Throat is dry</t>"]);
  205.         };
  206.         if (Thirst > 30) exitWith
  207.         {
  208.             _thirst ctrlSetStructuredText (parseText format ["<t font = 'PuristaBold' size = '1' align = 'left' color = '#ba1616'>I should drink now</t>"]);
  209.         };
  210.         if (Thirst > 15) exitWith
  211.         {
  212.             _thirst ctrlSetStructuredText (parseText format ["<t font = 'PuristaBold' size = '1' align = 'left' color = '#ba1616'>Dehydration</t>"]);
  213.         };
  214.         if (Thirst < 15) exitWith
  215.         {
  216.             _thirst ctrlSetStructuredText (parseText format ["<t font = 'PuristaBold' size = '1' align = 'left' color = '#ba1616'>Dehydration</t>"]);
  217.         };
  218.     } else {
  219.         _thirst ctrlSetStructuredText (parseText format ["<t font = 'PuristaBold' size = '1' align = 'left' color = '#3aa517'>Not Thirsty</t>"]);
  220.     };
  221.  
  222.     _earplugs = _ui displayCtrl 2001;
  223.  
  224.     if (fadedsound) then
  225.     {
  226.         _message = "<t align = 'left'><img size='2' image='\a3\ui_f\data\igui\rscingameui\rscdisplaychannel\mutevon_crossed_ca.paa'/></t>";
  227.         _earplugs ctrlSetStructuredText (parseText format ["%1", _message]);
  228.     } else {
  229.         _earplugs ctrlCommit 0;
  230.         _earplugs ctrlSetStructuredText (parseText format [""]);
  231.     };
  232.  
  233.     _statusbar = _ui displayCtrl 1103;
  234.     if (isNil {tax getVariable "threatlevel"}) then { tax setVariable ["threatlevel", 1, true]; diag_log "nice meme.";};
  235.     _threat = "<t align = 'right' color = '#3aa517'>Island Code: Green</t>";
  236.     _threatlevel = tax getVariable "threatlevel";
  237.     if (_threatlevel == 2) then {_threat = "<t align = 'right' color = '#ff9900'>Island Code: Amber<t";};
  238.     if (_threatlevel == 3) then {_threat = "<t align = 'right' color = '#ba1616'>Island Code: Red</t>";};
  239.     if (_threatlevel == 4) then {_threat = "<t align = 'right' color = '#FF4400'>Island Code: Martial Law</t>";};
  240.     _statusbar ctrlSetStructuredText (parseText format ["%1", _threat]);
  241.  
  242.     _seatbelt = _ui displayCtrl 12322;
  243.  
  244.     if (APX_seatbelt AND (!isNull objectParent player)) then
  245.     {
  246.         _seatbelt ctrlSetStructuredText (parseText format ["<t aign = 'center'><img size='2' image='Icons\seatbelt.paa'/></t>"]);
  247.     } else {
  248.         _seatbelt ctrlCommit 0;
  249.         _seatbelt ctrlSetStructuredText (parseText format [""]);
  250.     };
  251.  
  252.     _currentcall = _ui displayCtrl 1205;
  253.  
  254.     if (callInProgress) then
  255.     {
  256.         _currentcall ctrlSetStructuredText (parseText format ["<t aign = 'center'><img size='2' image='textures\phonecall.paa'/></t>"]);
  257.     } else {
  258.         _currentcall ctrlCommit 0;
  259.         _currentcall ctrlSetStructuredText (parseText format [""]);
  260.     };
  261.  
  262.     _uptime = _ui displayCtrl 1902;
  263.     _uptime ctrlSetStructuredText (parseText format ["<t align = 'left'>Uptime: %1</t>", [serverTime,"HH:MM:SS"] call BIS_fnc_secondsToString]);
  264.  
  265.     _battery = _ui displayCtrl 12371;
  266.     if (battery < 5) then
  267.     {
  268.         _battery ctrlSetStructuredText (parseText format ["<t aign = 'center'><img size='2' image='textures\battery.paa'/></t>"]);
  269.     } else {
  270.         _battery ctrlCommit 0;
  271.         _battery ctrlSetStructuredText (parseText format [""]);
  272.     };
  273.  
  274.     //update gopro
  275.     _gopro = _ui displayCtrl 444448;
  276.     if ( gopro && "CG_Pro_Item_i" in magazines player ) then
  277.     {
  278.         _message = "<img size='2' image='icons\record.paa'/>";
  279.         _gopro ctrlSetStructuredText parseText format["%1", _message];
  280.     }
  281.     else
  282.     {
  283.         if ( gopro ) then
  284.         {
  285.             gopro = false;
  286.         };
  287.         _message = "";
  288.         _gopro ctrlSetStructuredText parseText format["%1",_message];
  289.     };
  290.     _gopro ctrlCommit 0;
  291. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement