function GM:AmmoRegen(ply,name) local count = 0 if ply:GetActiveWeapon():IsValid() and ply:GetActiveWeapon() != NULL then count = ply:GetAmmoCount(ply:GetActiveWeapon():GetPrimaryAmmoType()) or 0 count = count + ply:GetActiveWeapon():Clip1() else return end for k,v in pairs(GameInfo.Weps) do if v.name == name then local total = count + v.regen if total > v.clip then ply:GiveAmmo(total - (count - v.regen), v.ammotype); else ply:GiveAmmo(v.regen, v.ammotype) end end end end //Don't fuck with the clips. GameInfo.Weps = {} GameInfo.Weps[1] = {name="weapon_p90", clip=50*4, regen=50*2, ammotype="smg1"} GameInfo.Weps[2] = {name="weapon_steyr", clip=30*4, regen=30*2, ammotype="smg1"} GameInfo.Weps[3] = {name="weapon_spas12", clip=36, regen=12, ammotype="buckshot"} GameInfo.Weps[4] = {name="weapon_famas", clip=10*5, regen=10*3, ammotype="smg1"}