Return to Main Docs Page

SWEP

Information about Scripted Weapons (SWEPs).

Shared Members



Type Name Description
Boolean AdminOnly NewerShared.png If false, admins can't spawn that weapon (you can set to false for base weapons).
Boolean AllowFlipping NewerShared.png Same as ViewModelFlip.
String AnimPrefix NewerShared.png This is for animations. (dont working rn)
Boolean MeleeWeapon NewerShared.png Does nothing, just from Source Engine combat weapon.
Table m_acttable NewerShared.png Table for activities (animations).
String Name NewerShared.png Used for name in SpawnMenu.
String PrintName NewerShared.png Used for name in Weapon Selection.
Table Primary NewerShared.png Contains infos about the primary attack.
Table Secondary NewerShared.png Contains infos about the secondary attack.
Boolean Spawnable NewerShared.png If false, players can't spawn that weapon (you can set to false for base weapons).
String ViewModel NewerShared.png Path to the view model (the weapon viewed from the player's point of view)
Boolean ViewModelFlip NewerShared.png Should the view model be flipped? (left handed weapon).
Number ViewModelFOV NewerShared.png An angle of FOV used for the view model.
String WorldModel NewerShared.png Path to the world model (the weapon viewed on the ground or in hands of NPCs).

Primary/Secondary Members



Type Name Description
String Ammo NewerShared.png Ammo type for the primary/secondary fire mode ("Pistol", "SMG" etc)
Boolean Automatic NewerShared.png Should the weapon keep firing if the player's mouse is still down?
Integer ClipSize NewerShared.png The size of a clip (how much you can shoot before you reload)
Integer DefaultClip NewerShared.png The default amount of ammo to give when you get the weapon

Server-Side Members



Type Name Description
Boolean AutoSwitchFrom NewerServer.png Auto switch from if you pick up a better weapon.
Boolean AutoSwitchTo NewerServer.png Auto switch to if we pick it up.
Integer Weight NewerServer.png Decides whether we should switch from/to this.

Client-Side Members



Type Name Description
Number BobScale NewerClient.png The scale of the viewmodel bob (1.0 default).
Boolean DrawAmmo NewerClient.png Should draw the default HL2 ammo counter.
Boolean DrawCrosshair NewerClient.png Should draw the default crosshair.
Integer Slot NewerClient.png Slot in the weapon selection menu.
Integer SlotPos NewerClient.png Position in the slot.
Float SwayScale NewerClient.png The scale of the viewmodel sway (1.0 default).
String WepSelectIcon NewerClient.png Path to an texture. Override this in your SWEP to set the icon in the weapon selection.