Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fnc_p2flashGold = {
- private["_in","_rt","_cl","_am","_fa","_di","_p","_r","_g"];
- disableSerialization;
- _in = nil; _r = 0; _g = 0; _p = "";
- _in = _this;
- _cl = _in select 0;
- _am = _in select 1;
- _rt = 5;
- if (_cl) then {
- _di = ((uiNamespace getVariable 'p2GoldUI') displayCtrl 8291);
- _r = 1; _g = 0; _p = "";
- } else {
- _di = ((uiNamespace getVariable 'p2GoldUI') displayCtrl 8292);
- _r = 0; _g = 1; _p = "+";
- };
- _di ctrlSetTextColor [_r,_g,0,1];
- _di ctrlSetStructuredText parseText("<t align='right' size='0.95'>" + _p + str _am + "</t>");
- uiSleep (_rt - 1);
- _fa = 1;
- for "_i" from 1 to 100 do {
- _fa = _fa - 0.01;
- _di ctrlSetTextColor [_r,_g,0,_fa];
- uiSleep 0.01;
- };
- _di ctrlSetStructuredText parseText(" ");
- };
- p2GoldFlashThread = [] spawn {
- private["_p2o","_p2on","_p2n","_p2nn","_p2pm","_di","_rFT","_gFT","_dim","_dip"];
- disableSerialization;
- _di = ((uiNamespace getVariable 'p2GoldUI') displayCtrl 8290);
- _dim = ((uiNamespace getVariable 'p2GoldUI') displayCtrl 8291);
- _dip = ((uiNamespace getVariable 'p2GoldUI') displayCtrl 8292);
- _rFT = nil;
- _gFT = nil;
- if (!isNil "_di") then {
- while {true} do {
- _p2o = ctrlText _di;
- waitUntil{(_p2o != ctrlText _di)};
- _p2n = ctrlText _di;
- _p2on = parseNumber _p2o;
- _p2nn = parseNumber _p2n;
- _p2pm = 0;
- if (_p2on < _p2nn) then {
- _p2pm = _p2nn - _p2on;
- } else {
- _p2pm = _p2nn - _p2on;
- };
- if (_p2pm < 0) then {
- if (!isNil '_rFT') then {
- _p2pm = _p2pm + (parseNumber (ctrlText _dim));
- terminate _rFT; _rFT = nil;
- _rFT = [true,_p2pm] spawn fnc_p2flashGold;
- } else {
- _rFT = [true,_p2pm] spawn fnc_p2flashGold;
- };
- } else {
- if (!isNil '_gFT') then {
- _p2pm = _p2pm + (parseNumber (ctrlText _dip));
- terminate _gFT; _gFT = nil;
- _gFT = [false,_p2pm] spawn fnc_p2flashGold;
- } else {
- _gFT = [false,_p2pm] spawn fnc_p2flashGold;
- };
- };
- };
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment