Place the following to your init.sqf for example:
PHP Code:
TAG_fired =
{
_unit = _this select 0; //The unit that fired the weapon
_wpn = _this select 1; //The weapon that was fired
_muzzle = _this select 2; //The muzzle of the weapon that fired
_ammo = _this select 4; //The ammunition type (classname) of the fired projectile
if (_wpn == "Throw" && _muzzle == "SmokeShellMuzzle") then //A smoke grenade was thrown
{
_smoke = (getPos _unit) nearestObject _ammo; //Get the object
if (!isNull _smoke) then //Make sure the above didn't fail
{
hint format ["The smoke grenade is: %1", _smoke];
//Some addition handling, do not forget to spawn/execVM if you want to use sleep/waitUntil!
};
};
};
unit addEventHandler ["fired", {_this call TAG_fired}];