basically, you've got the idea about how to check to see if an enemy sees a smoke grenade. Now to make the enemy fire a smoke grenade in the general direction of the smoke grenade.
basic layout:
find linear regression, given the postion of the selected enemy unit, and the position of the smoke grenade.
here's the formula that will get you the slope of the line:
_pos1 is the position of the enemy and _pos2 is the position of the smoke grenade on the ground
_s = (_pos1 select 0) + (_pos2 select 0)
_y = (_pos1 select 1) + (_pos2 select 1)
_q = (_pos1 select 0)^2 + (_pos2 select 0)^2
_l = (_pos1 select 1)^2 + (_pos2 select 1)^2
_p = ((_pos1 select 0)*(_pos1 select 1)) + ((_pos2 select 0)*(_pos2 select 1))
_n = 2;
_d = (_n*_q)-(_s^2)
_m = ((_n*_p)-(_s*_y))/_d
_m is the slope value
Then use this value to set the x and y positions for the smoke grenade
#handle
_pos1 set[1, (_pos1 select 1)+((_m)*_count)/100]
_pos1 set[0, (_pos1 select 0)+(_count)/100]
_count = _count + 1
if(_count == 100)then{_smoke = "smokeshell" camcreate _pos1 ;exit} //When _count is equal to 100, camcreate a smoke grenade there.
Goto "handle"
above will create the smoke grenade. If you don't want to do that, you can order the unit to face towards the direction of the smoke grenade and then order him to fire.
personally that would be better, however, the above script will allow you to check and see if something is blocking the view of the enemy units.
Thanks,
Bluelikeu