There are a couple of ways to fix your script... the first involves putting
smokeshell in quotes:
init: dude AddEventHandler ["fired",{[
"smokeshell
"[/u] ] exec "fire.sqs"}]
Also, add another = sign
? _ammo =
= "smokeshell": hint "it worked"
It wasn't working because _ammo was equal to: smokeshell
Rather than "smokeshell", and because you need two ='s to compare things, rather than one
The other way is to detected the actual ammo the unit is firing, rather than just putting "smokeshell". LCD is on the right track... you'd be looking at something like this:
init: dude AddEventHandler ["fired",{[_this select
x ] exec "fire.sqs"}]
ammo = _this select 0
? _ammo == "smokeshell": hint "it worked"
I haven't got access to my ComRef at the moment, so I can't tell you what number exactly
x should be. However with smokeshells the magazine, projectile and ammo name are all "smokeshell". So anything between about 2 and 4 should do the trick
[size=0.5]
Edit: Oops... yabb doesn't like square brackets getting together...[/size]