It really isn't any different than creating the mele sword attack.
http://dl.getdropbox.com/u/1646976/sword.cap
Left/right Arrows - move
Shift - Jump
Space - Sword attack
Z - Use gun
I used a global variable so that you can't use the sword and the gun a the same time, if you would like to use both you could simply remove the variable checking conditions.
Again I hope it helps.