Jump to content
Sign in to follow this  
mr_shadow

Parsetext problem

Recommended Posts

Hello guys, I was editing the script with drawicon to parsetext

However I did not get the result.

I'm trying to change the icon to the text "Cadet"

["player", "onEachFrame", {







   private["_vis","_pos"];
   {
       if(player distance _x < 2.5) then
       {
           _vis = lineIntersects [eyePos player, eyePos _x,player, _x];
           if(!_vis) then
           {
		if (side _x == civilian) then {


		                _pos = visiblePosition _x;
               _pos set[2,(getPosATL _x select 2) + 2.2];
              drawIcon3D ["\a3\ui_f\data\map\Markers\NATO\b_inf.paa",[1,1,1,1],_pos,1,1,0,name _x,0,0.04];



		};
		if (side _x == west) then {




		if (_x getvariable "pluscop4" == 1) then{


               _pos = visiblePosition _x;
               _pos set[2,(getPosATL _x select 2) + 2.2];
               drawIcon3D ["a3\UI_F\data\GUI\Cfg\Ranks\captain_gs.paa",[1,1,1,1],_pos,1,1,0,name _x,0,0.04];
           }
		else{
					if (_x getvariable "pluscopcadet" == 1) then {


_pos = visiblePosition _x;
               _pos set[2,(getPosATL _x select 2) + 2.2];
               parsetext format ["Cadet %1",[1,1,1,1],_pos,1,1,0,name _x,0,0.04];

			};


		}
};};
       };
   } foreach playableUnits;






}, ""] call BIS_fnc_addStackedEventHandler;






It does not show the text "Cadet"

Share this post


Link to post
Share on other sites

So far as I am able to discern from your script, you are using the parseText command, but not assigning its return value to a variable, or providing it to some other command. parseText is returning to nothing.

I imagine that you seek something like this.

if (_x getVariable 'plusCopCadet' == 1)
then
{
   _pos = visiblePosition _x;
   _pos set[2, (getPosATL _x select 2) + 2.2];
   _cadetName = format ['Cadet %1', name _x];
   drawIcon3D ['a3\UI_F\data\GUI\Cfg\Ranks\captain_gs.paa', [1, 1, 1, 1], _pos, 1, 1, 0, _cadetName, 0, 0.04];
};

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×