Custom optics also need a model with a texture; I'll try to find a tutorial or a example somewhere...
EDIT: You need to put 'modelOptics = "pathofmodelforoptics.p3d"' into your config.cpp and you also need a p3d with a texture. I do not really remember how the p3d looks, but I think it was a 1x1m square.
EDIT2: I finally, after going through all my old archives, found a optics.p3d - it's not 1x1, it's much smaller - and I used a 512x512 texture (so 128x128, 256x256, etc will work on it). Originally I made it for a TIE fighter, but it'll work with a weapon, too - I don't know how to upload it here, so I'll email you.