Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. /*
  2. fn_getTimerStr.sqf
  3.  
  4. Copyright 2016 Jan Babor
  5.  
  6. Licensed under the Apache License, Version 2.0 (the "License");
  7. you may not use this file except in compliance with the License.
  8. You may obtain a copy of the License at
  9.  
  10. http://www.apache.org/licenses/LICENSE-2.0
  11.  
  12. Unless required by applicable law or agreed to in writing, software
  13. distributed under the License is distributed on an "AS IS" BASIS,
  14. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. See the License for the specific language governing permissions and
  16. limitations under the License.
  17.  
  18. */
  19. private["_request","_time","_hours","_minutes","_img","_text", "_rightTime"];
  20.  
  21. _request = [];
  22. _rightTime = (((correcto select 0) - startHour) - startMinute/60) * 60;
  23. _time = (round(_rightTime-(serverTime)/60));
  24.  
  25. _hours = (floor(_time/60));
  26. _minutes = (_time - (_hours * 60));
  27.  
  28. _img = [ExAd_SB_ICON_TIMER] call ExAd_fnc_formatSBImage;
  29. _text = format["%1:%2", _hours,(if(_minutes < 10 )then{format["0%1",_minutes]}else{_minutes})];
  30. _request pushBack [_img,_text];
  31.  
  32. if(ExAd_SB_COMPONENTS_ACTIVE_COLORS)then{
  33. if(_hours > 0)then{
  34. _request pushBack ([0,1,_hours] call ExAd_fnc_getSBColor)
  35. }else{
  36. _request pushBack ([0,60,_minutes] call ExAd_fnc_getSBColor)
  37. };
  38. };
  39.  
  40. _request call ExAd_fnc_formatSBOutput
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement