Give Weapon Ammo Issue
Hello gents. I'm trying to give a player a weapon when he walks over it; normally he'd be able to pick it up like normal, but he already has a primary weapon so I'm going around it with hamsandwich.
The giving part works fine, but the ammo doesn't go with it. The clip ammo does, but not the backpack ammo. So if I drop an SMG for example, with 23 rounds in the clip and 4 extra magazines, I go to pick it back up and only get those 23 rounds total - no extra magazines. Code:
So my question is, first of all, if anyone knows a better way around this. But assuming no one does, does anyone know where backpack ammo is stored? Is it on the person, or in the gun (which would be logical). If it's in the gun, where? Pdata (I've looked through some offsets to no avail)? Thanks in advance |
Re: Give Weapon Ammo Issue
How is it for counter-strike :
Bpammo are player offsets. When you drop a weapon, you keep the bpammo, that bpammo is shared for other weapons you could have. For example you use the same bpammo for glock18, mp5navy, tmp and elites. You only drop this bpammo when you die. Hope it's the same for dod ;) Good research :) Code:
#define OFFSET_AWM_AMMO 426 + EXTRAOFFSET // +44 |
Re: Give Weapon Ammo Issue
But conorr, correct me if I'm wrong here..but..
In CS, if you buy an AK47 and comma comma comma that sucker, so you've got 30x90, then bam some CT honkey kills you before you even fire a shot, comes up and steals your beautiful new Kalashnikov....he's gonna have 30x90 in there, is he not? Regardless of how much ammo he purchased prior? |
Re: Give Weapon Ammo Issue
You're right, but i told you before.
Quote:
Also bpammo is shared for multiple weapons, for exemple usp, ump45 and mac10. usp is a gun, ump45 and mac10 are smgs. Suppose you have those weapons : usp 12/100 mac10 30/100 You shoot 5 bullets with the usp -> 7/100 You reload it --> 12/95 Switch to mac10 --> 30/95 Hope it helps you :) |
Re: Give Weapon Ammo Issue
Quote:
Should he arrive spawn-wards and kindly request you chuck your hands in the air and your AK on the floor, then assuming you acquiesce, he would walk off but one AK and 30 rounds richer. I assume that when you did your data dump of the item it was a gun that was dropped from killing, and not "drop", right? |
Re: Give Weapon Ammo Issue
Actually, I'm dropping it. And then picking it back up myself. So it seems when I drop it, either my bpammo gets lost or it doesn't get applied once I pick it back up. Because once I pick it back up I only have what was in the clip on dropping it.
|
Re: Give Weapon Ammo Issue
That's just weird.
Last time I checked, you just keep the ammo when you drop it. Unless that's your existing code screwing you over for 3 clips. If you have an AK with 3 spare clips, and swap your AK with someone who only had 1 spare clip (both drop + pick up each others) you would both have the same BPammo as you started with, but whatever gun-ammo was in the other guy's rifle. Try scanning offsets and that after slaying yourself instead. |
| All times are GMT -4. The time now is 11:04. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.