Hello:
I want create one script that create one action to the leader of the group with the name of the inhured player in his group for can select ans send one medic to this unit to heal, if i have several inhured units i create several actions in one time with this code:
TAH =[];
_Units = Units Player;
For [{_i=0}, {_i <= (Count _Units)}, {_i=_i+1}] do
{
If (Damage (_Units Select _i)>0.1 && Damage (_Units Select _i) < 1) Then {
TAH Set [_i,Format["ASH%1",_i]];
Player addaction [name(_Units select _i),"Scripts\Medic\Heal.sqf",(_Units select _i)];
};
};
With This code i can create one action in the leader for every player or Ia inhured inside of the Leader group but i want create one Index for can delete all the actions when you click in one of this, for this i create the table TAH=[]; I go inserting in this line TAH Set [_i,Format["ASH%1",_i]]; one new element to the talbe like this ASH0, ASH1, ASH2 etc etc, and if i put this index to the action like this:
(TAH Select _i) = Player addaction [name(_Units select _i),"Scripts\Medic\Heal.sqf",(_Units select _i)];
I get one error.
The other problem is in the Scripts that i call when i press the action, i can not delete all the Actions because i have not index for this, i try to made some thing like this:
_Units = Units Player;
For [{_i=0}, {_i <= (Count _Units)}, {_i=_i+1}] do
{
If (Damage (_Units Select _i)>0.1 && Damage (_Units Select _i) < 1) Then {
player removeaction (TAH Select _i);
};
};
I get other error here: player removeaction (TAH Select _i); and (TAH Select _i) is ASH0 but the game say waiting number and it is one String.
Can some guy help me??
Regards