Wadmann - Yes, thanks. That at least by just looking at the script seems to do the trick. Haven't tested it yet though. and as someone said in the thread linked by bedges (how on earth did I miss it with the search function? One of life's little mysteries no doubt.) if there's a delay of say 3 seconds at the start of the second script the shell has had time to land. _unit in the second script might as well be player.
edit: Based on Wadmann's advice, and on the stuff found in the linked thread, I ended up with this. Tested and works.
In a trigger:
player addEventHandler ["Fired", {if ((_this select 3 == "SmokeShell") or (_this select 3 == "SmokeShellGreen") or (_this select 3 == "SmokeShellRed")) then {[_this select 3] exec "smoke.sqs"}}]
and smoke.sqs:
~3
_ammo = _this
_smoke = nearestobject [player, _ammo]
_smokepos = getpos _smoke
Hland setpos _smokepos
? _ammo == "SmokeShell" : smokecolour = "white"
? _ammo == "SmokeShellRed" : smokecolour = "red"
? _ammo == "SmokeShellGreen" : smokecolour = "green"
player sideChat format ["popping %1 smoke", smokecolour]
exit
Hland is the name of the invisible H.
the smokecolour part is for radio conversation:
player: "Popping smoke."
heli: "I spot green smoke, confirm."
p: "Green smoke confirmed."
...and so on.