Jump to content
  • 0

Can't get this to work!


Reaper5150

Question

Could anyone tell me what I'm doing wrong here? I'm wanting these PAA images to change on the players hud based on the humanity they currently have.

 

_humanity = player getVariable['humanity',0];
if(_humanity > 999999)then
{
    _humanity = [_humanity] call fnc_format_humanity;
    _humanity = toArray _humanity;
    _humanity = _humanity - [44];
    _humanity = toString _humanity;
};

// text
_ctrl = _display displayCtrl 7020;
_ctrl ctrlSetText format ["%1", _humanity];

// Humanity icons
if (_humanity < -5000) then {
    _path = "HUD\images\bandit.paa";
    };
};
if (_humanity < -20000) then {
    _path = "HUD\images\Pro.paa";
} else {
if (_humanity > 5000) then {
    _path = "HUD\images\hero.paa";
    };
};
if (_humanity > 20000) then {
    _path = "HUD\images\Pro.paa";
    } else {
        _path = "HUD\images\survivor.paa";
    };
};
_ctrl = _display displayCtrl 7010;
_ctrl ctrlSetText _path;

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...