Yes you can skin an entrire weapon with just one texture file, it's not advisable cause you probably won't achieve much qualityand detail, but yes you can.
And the problem of your weapon not woking properly, is probably due to a bad .cpp file, read a nice tutorial about cpp files and you'll have 70% of your problem solved