Thanks for all of that.
But it remains complicated solutions.
Otherwise, perhaps i found a good way to do it.
Here are some news:
1) I found the LaserTarget object (the spot) has a direction (0 to 360°).
2) Using a part of the math given by Mandoble about the weaponDirection command from his "mando_my_weapon" function:
_dirweap = ((_unit weaponDirection _weap) select 0) atan2 ((_unit weaponDirection _weap) select 1);Which converts the tridimentionnal values of the command to angles (negative for the West, positive for the East).
Where i did:
_unit = player;
_weap = "LaserDesignator";
_dirweap = ((_unit weaponDirection _weap) select 0) atan2 ((_unit weaponDirection _weap) select 1);
if (_dirweap < 0) then
{
_dirweap = (360 + _dirweap);
};
if (_dirweap == 360) then
{
_dirweap = 0;
};
3) The LaserTarget object (the spot) has exactly the same direction as the LaserDesignator which make it.
Then the player who has got a designator where the direction is the same of the spot direction is the one who get points.
Otherwise i check the animation of the player this to avoid all players to run a script:
_allAnim = ["AwopPercMstpSoptWbinDnon_rfl","AwopPercMstpSoptWbinDnon_pst","AwopPercMstpSoptWbinDnon_non","AwopPknlMstpSoptWbinDnon_rfl","AwopPknlMstpSoptWbinDnon_pst","AwopPknlMstpSoptWbinDnon_lnr","AwopPpneMstpSoptWbinDnon_rfl","AwopPpneMstpSoptWbinDnon_pst","AwopPpneMstpSoptWbinDnon_non"];
_anim = animationState _unit;
if (_anim in _allAnim) then
{
for [{_loop ...................... etc ...These are the 9 possible animations of a unit using both LaserDesignator and Binocular.
I actualy have a beta script which needs to be tested on a server.
I'll keep you informed about it...
Thanks again.
Goullou