Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [] spawn {
- // Wait until the ScoreHUD is properly initialized
- waitUntil {
- private _scoreHUD = uiNamespace getVariable ["ScoreHUD", displayNull];
- !isNull _scoreHUD
- };
- // Retrieve the ScoreHUD display and progress bar control
- private _scoreHUD = uiNamespace getVariable "ScoreHUD";
- private _progressCtrl = _scoreHUD displayCtrl 1300;
- // Check if the progress bar control exists
- if (!isNull _progressCtrl) then {
- private _NUP_scoringInterval = missionNamespace getVariable ["NUP_scoringInterval", 25];
- private _NUP_startTime = missionNamespace getVariable ["NUP_startTime", time];
- // Update the progress bar continuously
- while {true} do {
- private _elapsedTime = time - _NUP_startTime;
- private _progress = (_elapsedTime / _NUP_scoringInterval) max 0 min 1; // Clamp progress to [0,1]
- // Update the progress bar's position
- _progressCtrl progressSetPosition _progress;
- // Sleep for 0.1 seconds before updating again
- sleep 0.1;
- };
- } else {
- diag_log "Error: Progress bar control not found in ScoreHUD!";
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement