Hello sniperz227,
Slowly, these have just been sample lines.
If you change your w_attack() code like you did it, you will not be able to see the animation.
Your .weaponframe will always be resettet to "0", so if you put a "if (self.weaponframe = 1)"
it will never pass it.
Also my "sound" line was only an example. I believe you dont even have a "boom.wav" file, do you ?
I just wanted to show what you could do.
If you are not sure how to start, I would suggest to leave the original code as it is and start this way to at least see your gun in action:
Create frames in your .mdl model similar to the original weapon (lets say the shotgun).
Name the frames (inside QME for example) according the original frames: "shot1" till "shot7" (fill up with dummy frames if you have only 5)
Now replace the shotgun with your weapon model.
Next step would be to adjust the existig code according to the real frame count that you have (you said you have 5 ?).
You can include now also sound or effect code lines if you want.
Proceed step by step and try to make it happen in small steps.
If you change too much at once you will be confused/lost quickly.
I am also an unexperienced coder, who still have to learn a lot.
I can suggest to read LordHavocs weapon tutorial (especially if you want to play around with it).
It teaches you basic things. I know it is not exactly what you want to do, but maybe it helps:
http://inside3d.com/showtutorial.php?id=194Also the reloading tutorial might be very interesting for you:
http://www.inside3d.com/showtutorial.php?id=249(There is one small mistake inside though. Read about it here:
viewtopic.php?f=2&t=4451Good luck.