ID:168797
Aug 25 2005, 7:01 pm
|
|
Ok! When you have no ammo and no clips left, you can unequip it and equip and you will have full ammo. Now I know why this happens. When you equip a gun it checks what gun you want to equip and sees what ammo and clips to have in it, when you unequip it it goes to nothin. Ex. - .9mm 0/0 - equip it and - 5/35 - use all ammo and clips -0/0 but!! unequip and equip...5/35!!! how can i make it thatit knows how much ammo and clips i used, like use half of the .9mm, start to use the AK47, come back and still have half the .9mm...not full ammo....i hope thas not confusing...
|
In response to Hiead
|
|
Hiead wrote:
Yoderic wrote: If not that, show us some relevant code. -Sin() |
Man, you already posted this. Go look at the other post. [link]
|
In response to Polaruis
|
|
Well, the way i do it is have 3 variables, the clip in its full amount, how many bullets are in current clip, and the total amount of ammo..
|
Yoderic wrote:
Ok! When you have no ammo and no clips left, you can unequip it and equip and you will have full ammo. Now I know why this happens. When you equip a gun it checks what gun you want to equip and sees what ammo and clips to have in it, when you unequip it it goes to nothin. Ex. - .9mm 0/0 - equip it and - 5/35 - use all ammo and clips -0/0 but!! unequip and equip...5/35!!! how can i make it thatit knows how much ammo and clips i used, like use half of the .9mm, start to use the AK47, come back and still have half the .9mm...not full ammo....i hope thas not confusing... this is my first attempt at helping someone, i will most likely fail, but here goes obj/var TOTALLY UNTESTED please, i beg you! dont copy and paste, just learn and write yer own |
In response to Echtolion
|
|
No put usr in proc.
Do not use ==o or ==1 for boolean vars. (!var) for 0, or (var) for 1. Don't use +=1 if you're going to add 1 to something such as a variable, instead use ++. -Sin() |
In response to Sinoflife
|
|
heh, i always forget that :P,i know i'd goof up some, but it was good for a first try i s'pose :o)
|
If I get what you're saying, you could just give the guns each a "remaining_bullets" or something var, to keep track of how many bullets are available for the gun type. Decrement it each time you fire off a shot.
Hiead