SWEP
Description
Information about Scripted Weapons (SWEPs), used by SANDBOX:PlayerGiveSWEP and in SWEP creation.
For list of callbacks, see WEAPON Hooks.
While some of the fields may be serverside or clientside only, it is recommended to provide them on both so addons could use their values.
Members
Default: "#spawnmenu.category.other"
Default: false
Default: GetConVar('sv_defaultdeployspeed'):GetFloat()
SWEP
instead. However, if called in a SWEP method; use self
instead.Default: false
ViewModelFlip
, but for the second view model.Default: false
ViewModelFlip
, but for the third view model.Default: false
Default: true
Default: true
Default: 5
Default: 1
Default: 1
Default: true
Default: surface.GetTextureID( 'gui/speech_lid' )
.vmt
file, NOT .vtf
.
Alternatively you can render custom weapon selection via WEAPON:DrawWeaponSelection.
Default: surface.GetTextureID( 'weapons/swep' )
Default: false
Default: false
- string
Ammo
- Ammo type (Pistol
,SMG1
, etc.) See game.AddAmmoType. - number
ClipSize
- The maximum amount of bullets one clip can hold. Setting it to-1
means weapon uses no clips, like a grenade or a rocket launch. - number
DefaultClip
- Default ammo in the clip, making it higher than ClipSize will give player additional ammo on spawn - boolean
Automatic
- If true makes the weapon shoot automatically as long as the player has primary attack button held down
Default: false
Default: false
Default: "weapon"
Default: true
materials/
folder.Default: "entities/<ClassName>.png"