ok for the height detection you can use this as a condition
getpos unitname select 2 >= 5
that will activate when the unit is about 5 metres, are you placing the streetlight? if you are use this condition
getdammage lightname > 0
the weapon firing part is the hardest, does the player startwith the weapon? or does he have to kill a guard to get it? if he starts with it or picks it up unused use this
shots = unitname ammo "weaponname"
@(unitnamer ammo "weaponname") < shots