Hey guys, I'm here again.
I've got an issue with editing clip size in galil to be only able to hold 2 bullets. I can change the gun's clip easily like this:
cs_set_weapon_ammo(find_ent_by_owner(-1, "weapon_galil", id), 2)
This command works just fine, but I also want this to work when I reload the gun, instead the galil after reloading gets 35 ammo and I couldn't find any solution to this for some reason, the only thing I've potentially got:
PHP Code:
public ham_reload_post(ent)
{
static id; id = get_pdata_cbase(ent, 41, 4)
if(get_pdata_int(ent, 54, 4) && get_pdata_float(id, 83, 5) <= 0.0)
{
if(mushmaker[id]) set_pdata_int(ent, 51, 2, 4)
}
}
but it doesn't work, so I'll be glad for your advice.
Have a great day.