player2_dz

Untitled

Feb 11th, 2015
348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.96 KB | None | 0 0
  1.  
  2. fnc_p2flashGold = {
  3.     private["_in","_rt","_cl","_am","_fa","_di","_p","_r","_g"];
  4.     disableSerialization;
  5.     _in = nil; _r = 0; _g = 0; _p = "";
  6.     _in = _this;
  7.     _cl = _in select 0;
  8.     _am = _in select 1;
  9.     _rt = 5;
  10.  
  11.     if (_cl) then {
  12.         _di = ((uiNamespace getVariable 'p2GoldUI') displayCtrl 8291);
  13.         _r = 1; _g = 0; _p = "";
  14.     } else {
  15.         _di = ((uiNamespace getVariable 'p2GoldUI') displayCtrl 8292);
  16.         _r = 0; _g = 1; _p = "+";
  17.     };
  18.  
  19.     _di ctrlSetTextColor [_r,_g,0,1];
  20.     _di ctrlSetStructuredText parseText("<t align='right' size='0.95'>" + _p +  str _am + "</t>");
  21.  
  22.     uiSleep (_rt - 1);
  23.     _fa = 1;
  24.     for "_i" from 1 to 100 do {
  25.         _fa = _fa - 0.01;
  26.         _di ctrlSetTextColor [_r,_g,0,_fa];
  27.         uiSleep 0.01;
  28.     };
  29.  
  30.     _di ctrlSetStructuredText parseText(" ");
  31. };
  32.  
  33.  
  34. p2GoldFlashThread = [] spawn {
  35.     private["_p2o","_p2on","_p2n","_p2nn","_p2pm","_di","_rFT","_gFT","_dim","_dip"];
  36.     disableSerialization;
  37.     _di = ((uiNamespace getVariable 'p2GoldUI') displayCtrl 8290);
  38.     _dim = ((uiNamespace getVariable 'p2GoldUI') displayCtrl 8291);
  39.     _dip = ((uiNamespace getVariable 'p2GoldUI') displayCtrl 8292);
  40.     _rFT = nil;
  41.     _gFT = nil;
  42.     if (!isNil "_di") then {
  43.         while {true} do {
  44.             _p2o = ctrlText _di;
  45.             waitUntil{(_p2o != ctrlText _di)};
  46.             _p2n = ctrlText _di;
  47.             _p2on = parseNumber _p2o;
  48.             _p2nn = parseNumber _p2n;
  49.             _p2pm = 0;
  50.             if (_p2on < _p2nn) then {
  51.                 _p2pm = _p2nn - _p2on;           
  52.             } else {
  53.                 _p2pm = _p2nn - _p2on;
  54.             };
  55.             if (_p2pm < 0) then {
  56.                 if (!isNil '_rFT') then {
  57.                     _p2pm = _p2pm + (parseNumber (ctrlText _dim));
  58.                     terminate _rFT; _rFT = nil;
  59.                     _rFT = [true,_p2pm] spawn fnc_p2flashGold;
  60.                 } else {
  61.                     _rFT = [true,_p2pm] spawn fnc_p2flashGold;
  62.                 };
  63.             } else {
  64.                 if (!isNil '_gFT') then {
  65.                     _p2pm = _p2pm + (parseNumber (ctrlText _dip));
  66.                     terminate _gFT; _gFT = nil;
  67.                     _gFT = [false,_p2pm] spawn fnc_p2flashGold;
  68.                 } else {
  69.                     _gFT = [false,_p2pm] spawn fnc_p2flashGold;
  70.                 };
  71.             };
  72.         };
  73.     };
  74. }
Advertisement
Add Comment
Please, Sign In to add comment