blackHat to edit ammo value you will need to set the ammo for every weapon slot:
WeaponSlot // Total 28Bytes
DWORD type // + 0
DWORD state // + 4 (0 idle, 1 firing, 2 reloading)
DWORD AmmoInClip // + 8
DWORD AmmoRemaining // +12
FLOAT unknown // +16 (increases each time you fire your weapon, 0 when weapon not active,
probably used to count bullets fired to know when to reload?)
UNKNOWN 0..7 Bytes // +20 (unknown - goggle mode, 0 off and 256 on)...+27
WeaponSlot.type
(Slot0: No Weapon) (Slot2: Handguns)
0 - Fist 22 - Pistol
1 - Brass Knuckles 23 - Silenced Pistol
(Slot1: Melee) 24 - Desert Eagle
2 - Golf Club (Slot3: Shotguns)
3 - Nitestick 25 - Shotgun
4 - Knife 26 - Sawn-Off Shotgun
5 - Baseball Bat 27 - SPAS-12
6 - Shovel (Slot4: Sub-Machineguns)
7 - Pool Cue 28 - Micro Uzi
8 - Katana 29 - MP5
9 - Chainsaw 32 - TEC-9
15 - Cane
(Slot5: Machineguns) (Slot10: Gifts)
30 - AK47 14 - Flowers
31 - M4 (Slot9:Special1)
(Slot6: Rifles) 42 - Fire Extinguisher
33 - Country Rifle 43 - Camera
34 - Sniper Rifle (Slot11:Special2)
(Slot7: Heavy Weapons) 44 - NV Goggles
35 - Rocket Launcher 45 - IR Goggles
36 - Heat Seaking RPG 46 - Parachute
37 - Flame Thrower (Slot12
etonators)
38 - Minigun 40 - Detonator(for remote explosives)
(Slot8: Projectiles)
16 - Grenade
18 - Molotov Cocktail
39 - Remote Explosives
(No slot: Fired from hunter / hydra / missile launcher)
(This type is stored in the rocket pool as rocket type, but is the continuation of this list)
19 - Normal rockets
20 - Heatseeking rockets
58 - Flares
If you have VB 2008 IDE you can check out my Weapon Spawner, it has a automated spawn function and there you will see how ammo is set.Anyways ill explain you here too:
Lets change ammo for slot number 4 (sub-machine guns)
First slot (0) address is CPed + 5A0, you can see in the addresses page that CPed is: B6F5F0
so B6F5F0 + 5A0 is a pointer to slot 0, next slot wll be +1C to the address pointed by CPed + 5A0.
Lets explain pointers for first, CPed + 5A0 means that CPed's value + 5A0 is pointing to this address, so you have to ReadProcessMemory on B6F5F0 (CPed) and then add 5A0 to that value (hex, or just convert it to dec and it will be 1440)
So after doing it, you have proper address to slot 0 lets say its ABC321, but this is the address to slot 0, and we need slot 4 so what we will do is to add the offset 1C four times to get the proper address (1C because it says WeaponSlot is total 28 bytes (28 to hex = 1C, you can convert dec to hex and hex to dec using just windows calculator, you just need to change view to scientific)
So our offset to address ABC321 will be 1C + 1C + 1C + 1C = 70, so our slot 4 is ABC32 + 70 = ABC391
So when we finally have the address to our slot 4, and we want to change the ammo value (total amo, not ammo in clip) we can see "DWORD AmmoRemaining // +12" on the Memory Addresses website, so we do the same.. ABC391 + 12 = ABC3A3
Now, all you need to do is just write your desired ammo value to ABC3A3
and its done, (if you want to spawn weapons, then remember that you cant spawn a weapon in other slot than in the website, you cant just spawn deagle in sub machine guns ! and if you spawn a weapon by writing its ID to the slot, you will also have to set the ammo value (otherwise you wont see the gun))