View Full Version: [Code] Easy Weapon Display

wolfers >>Coding Alliance >>[Code] Easy Weapon Display


<< Prev | Next >>

Conner94- 02-12-2005
[Code] Easy Weapon Display
This name doesn't fit well, but what the tutorial does is easily let you have weapons with diffrent status bar images without nasy "if" statements. Lets begin. Open Up WL_Agent and go to the Draw Weapon Function. Replace the whole this with this: Update! Kyo found a bug in the following code! If you used it before 02/16/2005, go over it again! ================== = = DrawWeapon = Conner94's = Version = = Based off of = BrotherTanks's Ammo = In the Same Place = Tutorail = ================== */ void DrawWeapon (void) { switch (gamestate.chosenweapon) { case wp_newweaponwithnewimage: //change this to your new weapon StatusDrawPic (32,8,yourimage); //change to your image break; //Make sure you have this! default: StatusDrawPic (32,8,KNIFEPIC+gamestate.weapon); break; //Make sure you have this! } } /* There you go. Based off of BrotherTank's ammo in same place. Add as many cases as you need.

Mega Luigi- 02-13-2005

Yes, I think is a good idea. I don't like to add that images, but now I will not lost too much time. Thanks Conner94 by this tutorial. :)

Conner94- 02-13-2005

Update! If you see the key image when using a higher weapon, you must change it a bit. See first post for details.

Kyo Kusanagi- 02-15-2005

You forgot to put the Break; in here is my Ex: void DrawWeapon (void) { switch (gamestate.chosenweapon) { case wp_knife: StatusDrawPic (32,8,KNIFEPIC); break; case wp_pistol: StatusDrawPic (32,8,GUNPIC); break; case wp_machinegun: StatusDrawPic (32,8,MACHINEGUNPIC); break; case wp_chaingun: StatusDrawPic (32,8,GATLINGGUNPIC); break; case wp_shotgun: StatusDrawPic (32,8,NEWPIC); break; case wp_sten: StatusDrawPic (32,8,NEWPIC1); break; case wp_rifle: StatusDrawPic (32,8,NEWPIC2); break; case wp_colt: StatusDrawPic (32,8,COLTPIC); break; case wp_dshotgun: StatusDrawPic (32,8,DSHOTGUNPIC); break; } } 100% it works

Kyo Kusanagi- 02-15-2005

I'm soo smart :D :D :D :D :D :D :D :D

Deathshead- 02-19-2005

I had also done this with Extreme. It's good isn't it. There's probably an even easier way as well I bet. Good for sharing it Conner

Forumer™ is Voted #1 Free Forum Hosting provider
Build your own community today with the largest message board hosting company.