SWEP Help

Is there any way to get the swep code for default weapons(crowbar, pistol, smg, etc.)?
If not, can I at least get the name of reload sound files for default weapons?

Also, for some reason my swep starts with 280 ammo, but I set the default clip to 24. Here’s some of my code.

[lua]
//PrimaryFire Settings\
SWEP.Primary.Sound = “weapon_Crossbow.Single”
SWEP.Primary.Damage = 50
SWEP.Primary.TakeAmmo = 1
SWEP.Primary.ClipSize = 1
SWEP.Primary.Ammo = “Pistol”
SWEP.Primary.DefaultClip = 24
SWEP.Primary.Spread = 0.1
SWEP.Primary.NumberofShots = 1
SWEP.Primary.Automatic = false
SWEP.Primary.Recoil = 2
SWEP.Primary.Delay = 0.1
SWEP.Primary.Force = 100
SWEP.Primary.AngVelocity = Angle(0,0,0)
//PrimaryFire settings\

//SWEP:Initialize()\
function SWEP:Initialize()
util.PrecacheSound(self.Primary.Sound)
if ( SERVER ) then
self:SetWeaponHoldType( self.HoldType )
end
end
//SWEP:Initialize()\

function SWEP:Reload()

if self.ReloadingTime and CurTime() <= self.ReloadingTime then return end

if ( self:Clip1() < self.Primary.ClipSize and self.Owner:GetAmmoCount( self.Primary.Ammo ) > 0 ) then

	self:DefaultReload( ACT_VM_RELOAD )
            local AnimationTime = self.Owner:GetViewModel():SequenceDuration()
            self.ReloadingTime = CurTime() + AnimationTime
            self:SetNextPrimaryFire(CurTime() + AnimationTime)
            self:SetNextSecondaryFire(CurTime() + AnimationTime)
//self:EmitSound(????????(see above))
end

end

//SWEP:Throw_Attack(Model, Sound, Angle)\
function SWEP:Throw_Attack (Model, Sound, Angle)
local tr = self.Owner:GetEyeTrace()
self.Weapon:EmitSound (Sound)
self.BaseClass.ShootEffects (self)
if (!SERVER) then return end
local ent = ents.Create (“prop_physics”)
ent:SetModel (Model)
ent:SetPos (self.Owner:EyePos() + (self.Owner:GetAimVector() * 16))
ent:SetAngles (self.Owner:EyeAngles())
ent:Spawn()
local phys = ent:GetPhysicsObject()
local shot_length = tr.HitPos:Length()
phys:ApplyForceCenter (self.Owner:GetAimVector():GetNormalized() * math.pow (shot_length, 7))
phys:AddAngleVelocity(Angle)
cleanup.Add (self.Owner, “props”, ent)
undo.Create (“Thrown model”)
undo.AddEntity (ent)
undo.SetPlayer (self.Owner)
undo.Finish()
end
//Throw_Attack(Model, Sound, Angle)\

//SWEP:PrimaryFire()\

function SWEP:PrimaryAttack()
if ( !self:CanPrimaryAttack() ) then return end
if self.Primary.Clip != 0 then
self:TakePrimaryAmmo(self.Primary.TakeAmmo)
self:Throw_Attack (“models/props_junk/sawblade001a.mdl”, self.Primary.Sound, self.Primary.AngVelocity)
self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
self:Reload()
end
end
//SWEP:PrimaryFire()\

function SWEP:CanPrimaryAttack()
if ( self:Clip1() <= 0 ) then
self:EmitSound( “Weapon_Pistol.Empty” )
self:SetNextPrimaryFire( CurTime() + 0.2 )
self:Reload()
return false
end
return true
end
[/lua]

Line 5 and Line 7, I think.
EDIT: As in, I think that’s whats wrong.

[editline]30th January 2011[/editline]

Check your settings folder, they should be there.
garrysmod/garrysmod/settings

The default weapons are not scripted Lua, they’re hard-coded into the game engine in C++.
To find the reload sounds, just look in the “scripts” folder of each game’s .gcf archive and look for “game_sounds_weapons.txt” or something similar. You can also use the Sound Browser tool in Hammer, which I’ve found to be really useful and reliable.

You spawn with 256 reserve “smg” ammo; the “default clip” adds 24 to this.

If you want an easier tutorial and how to find all the gun names AND prop names so you can fire props.
Go here:

So how do I make the swep use its own ammo instead of the smg’s ammo?