View Single Post
Silencer123
Veteran Member
Join Date: Jul 2006
Old 06-07-2009 , 09:59   Re: Changing clip and backpack ammo in Half-Life
Reply With Quote #3

This is all I found:
PHP Code:
#include <hamsandwich>
// [...]
ExecuteHam(Ham_GiveAmmoplayerIdammoToAddtype[], bAmmoMax);
// [...] 
Where type would be the ammo type. Unfortunately
"type" is not simply ammo_xyz, but some internal names.
E.g. for radioactive ammo (ammo_gaussclip) you'd write "uranium",
and for crossbow ammo (ammo_crossbow) you'd write "bolts".
The others are "357", "9mm", "buckshot", "rocket" and "ARgrenades".
Took me some time to figure them all out, especially "uranium".

This works, but it changes backpack ammo only. ("uranium" and "ARgrenades" excepted)
My great plan is to directly change clip ammo.
Other Hamsandwich functions only allow to read ammo.
I might use Ham_Player_UpdateClientData, but I don't
know the offsets.

It would be great if you could search for that thread you have in mind.
You'd probably recognize it faster than me?

Thanks in advance.
__________________
EAT YOUR VEGGIES

Last edited by Silencer123; 06-07-2009 at 10:04.
Silencer123 is offline