try attaching the ammo_pickup() to a key
in your main you would put on_w = ammo_pickup;
this assigns the w key the function of "ammo_pickup"
if you need to call a function you wrote off this, you could type
function give_ammo()//or whatever name you want
{
my.ammo_pickup();
}
then assign the w key to it in your main
on_w = give_ammo