I want to give players extra ammo when they pickup a weapon. For some reason it does not always work.
My guess is that I need to set the ammo type variable per player. But how do you do that in lua? I tried v.ammotype but that screws up the server creating loads of errors :<
hook.Add(“WeaponEquip”, “ammofix”, function(weapon)
for k, v in pairs( player.GetAll() ) do
if !v:Alive() or v:IsFrozen() then return end local ammotype = weapon:GetPrimaryAmmoType() if weapon == "weapon_crowbar" then return end v:SetAmmo( 9999 , ammotype ) end