I have an entity that should give a custom weapon + primary ammo when I press E on it, but it gives secondary ammo instead.
Entity +use code:
[CODE]function ENT:Use( activator, caller, useType, value)
if (caller:IsPlayer()) then
if caller:HasWeapon("ghostball") then return false end
caller:Give("ghostball")
caller:GiveAmmo( 1, "Pistol", true )
self:Remove()
end
end[/CODE]
I have setup the SWEP's ammo type like this:
[CODE]SWEP.Primary.ClipSize = 1
SWEP.Primary.DefaultClip = 0
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = "Pistol"
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = "none"[/CODE]
When I press +use on the entity, it gives me the weapon, and +1 ammo in the secondary clip, instead of +1 ammo in the primary.
Sorry, you need to Log In to post a reply to this thread.