Advertisement
Guest User

hokies error

a guest
Jan 22nd, 2017
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 23.17 KB | None | 0 0
  1. function SWEP:Deploy()
  2.  
  3.     if self.Callback.Deploy then
  4.         local val = self.Callback.Deploy(self)
  5.         if val then return val end
  6.     end
  7.  
  8.     if (!self.Primary.Damage) or (self.Primary.Damage<=0.01) then
  9.         self:AutoDetectDamage()
  10.     end
  11.  
  12.     if !self.Primary.Accuracy then
  13.         if self.Primary.ConeSpray then
  14.             self.Primary.Accuracy  = ( 5 / self.Primary.ConeSpray) / 90
  15.         else
  16.             self.Primary.Accuracy = 0.01
  17.         end
  18.     end
  19.  
  20.     if !self.Primary.IronAccuracy then
  21.         self.Primary.IronAccuracy = self.Primary.Accuracy * 0.2
  22.     end
  23.  
  24.     if self.MuzzleAttachment == "1" then
  25.         self.CSMuzzleFlashes = false
  26.     end
  27.  
  28.     self:CreateFireModes()
  29.  
  30.     self.ViewModelFOVDefault = self.ViewModelFOV
  31.     self.DefaultFOV=self.Owner:GetFOV()
  32.  
  33.     if self.DrawCrosshairDefault==nil then
  34.         self.DrawCrosshairDefault = self.DrawCrosshair
  35.     end
  36.  
  37.     self.isfirstdraw=false
  38.     if !self.hasdrawnbefore then
  39.         self.hasdrawnbefore = true
  40.         self.isfirstdraw=true
  41.         --self.Primary.DefaultClip = 0
  42.     end
  43.  
  44.     if self.isfirstdraw then
  45.         self:SetDeploySpeed(self.SequenceLength[ACT_VM_DRAW])
  46.     end
  47.  
  48.     self:ResetSightsProgress()
  49.  
  50.     self:DetectValidAnimations()
  51.  
  52.     self:AutoDetectRange()
  53.  
  54.     timer.Simple(0, function()
  55.         if IsValid(self) then
  56.             self:DetectValidAnimations()
  57.             self:ChooseDrawAnim()
  58.         end
  59.     end)
  60.  
  61.     if self.Owner:KeyDown(IN_ATTACK2) and self.SightWhileDraw then
  62.         self:SetIronSights(true)
  63.     end
  64.  
  65.     if self.Owner:KeyDown(IN_SPEED) and self.Owner:GetVelocity():Length()>self.Owner:GetWalkSpeed() then
  66.         self:SetSprinting(true)
  67.     end
  68.  
  69.     self:SetHoldType(self.HoldType)
  70.  
  71.     self.OldIronsights=(false)
  72.     self:SetIronSights(false)
  73.     self:SetIronSightsRaw(false)
  74.     self.OldSprinting=(false)
  75.     self.OldSafety=(false)
  76.     self:SetSprinting(false)
  77.     self:SetShooting(false)
  78.     self:SetChangingSilence(false)
  79.     self:SetCanHolster(false)
  80.     self:SetReloading(false)
  81.     self:SetShotgunInsertingShell(false)
  82.     self:SetShotgunCancel( false )
  83.     self:SetShotgunPumping(false)
  84.     self:SetShotgunNeedsPump(false )
  85.     self:SetFireModeChanging( false )
  86.     self:SetBoltTimer( false )
  87.     self:SetReloadingEnd(CurTime()-1)
  88.     self:SetShootingEnd(CurTime()-1)
  89.     self:SetDrawingEnd(CurTime()-1)
  90.     self:SetHolsteringEnd(CurTime()-1)
  91.     self:SetNextSilenceChange(CurTime()-1)
  92.     self:SetFireModeChangeEnd(CurTime()-1)
  93.     self:SetHUDThreshold(true)
  94.     self:SetHUDThresholdEnd(CurTime()+0.2)
  95.     self:SetBoltTimerStart(CurTime()-1)
  96.     self:SetBoltTimerEnd(CurTime()-1)
  97.     self:SetDrawing(true)
  98.     self:SetHolstering(false)
  99.     self:SetInspecting(false)
  100.     if self:GetSilenced()==nil then
  101.         self:SetSilenced(self.Silenced and self.Silenced or 0)
  102.     end
  103.     self:SetIronSightsRatio(0)
  104.     self:SetRunSightsRatio(0)
  105.     self:SetCrouchingRatio(0)
  106.     self:SetJumpingRatio(0)
  107.     self:SetSpreadRatio(0)
  108.     self:SetBurstCount(0)
  109.     self:SetInspectingRatio(0)
  110.     self:SetBursting(false)
  111.     self:SetUpSpread()
  112.     self:AutoDetectMuzzle()
  113.     self.PenetrationCounter = 0
  114.     if CLIENT or game.SinglePlayer() then
  115.         self.CLSpreadRatio=1
  116.         self.CLIronSightsProgress = 0
  117.         self.CLRunSightsProgress = 0
  118.         self.CLCrouchProgress = 0
  119.         self.CLInspectingProgress = 0
  120.         self.CLNearWallProgressProgress = 0
  121.     end
  122.     self:SetNextIdleAnim(CurTime()-1)
  123.     local vm = self.Owner:GetViewModel()
  124.     if IsValid(vm) then
  125.         self:SendWeaponAnim(0)
  126.         self.DefaultAtt = vm:GetAttachment(self:GetFPMuzzleAttachment())
  127.     end
  128.     local drawtimerstring = (self.SequenceEnabled[ACT_VM_DRAW] and 1 or 0)..","..(self.SequenceEnabled[ACT_VM_DRAW_EMPTY] and 1 or 0)
  129.  
  130.     self:InitDrawCode(drawtimerstring)
  131.  
  132.     self:CorrectScopeFOV( self.DefaultFOV and self.DefaultFOV or self.Owner:GetFOV() )
  133.  
  134.     self.customboboffset=Vector(0,0,0)
  135.  
  136.     self:ResetEvents()
  137.  
  138.     if SERVER then
  139.         self:CallOnClient("ResetEvents","")
  140.     end
  141.  
  142.     self:UpdateConDamage()
  143.  
  144.     self.LastSys = SysTime()
  145.  
  146.         if IsValid(self.Owner:GetViewModel()) then
  147.     self.Owner:GetViewModel():SetBodygroup(1, 3)
  148.      end
  149.     self:SendWeaponAnim(ACT_VM_DRAW)
  150.     self:SetBodygroup(1, 3)
  151.  
  152.     return true
  153. end
  154. function SWEP:Holster()
  155.     if IsValid(self.Owner:GetViewModel()) then
  156.     self.Owner:GetViewModel():SetBodygroup(1, 0)
  157.         self:SetBodygroup(1, 0)
  158.       end
  159.   return true
  160. end
  161.  
  162. SWEP.Gun                    = ("nut_honeybadger") --Make sure this is unique.  Specically, your folder name.
  163. if (GetConVar(SWEP.Gun.."_allowed")) != nil then
  164.     if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "tfa_blacklisted" SWEP.PrintName = SWEP.Gun return end
  165. end
  166. SWEP.Base               = "tfa_gun_base"
  167. SWEP.Category               = "Nutscript 1.1" --The category.  Please, just choose something generic or something I've already done if you plan on only doing like one swep.
  168. SWEP.Author             = "Dude" --Author Tooltip
  169. SWEP.Contact                = "" --Contact Info Tooltip
  170. SWEP.Purpose                = "Honey badger don't give a fuck." --Purpose Tooltip
  171. SWEP.Instructions               = "" --Instructions Tooltip
  172. SWEP.Spawnable              = true --Can you, as a normal user, spawn this?
  173. SWEP.AdminSpawnable         = false --Can an adminstrator spawn this?  Does not tie into your admin mod necessarily, unless its coded to allow for GMod's default ranks somewhere in its code.  Evolve and ULX should work, but try to use weapon restriction rather than these.
  174. SWEP.DrawCrosshair          = true      -- Draw the crosshair?
  175. SWEP.PrintName              = "AAC HoneyBadger"     -- Weapon name (Shown on HUD)
  176. SWEP.Slot               = 2             -- Slot in the weapon selection menu.  Subtract 1, as this starts at 0.
  177. SWEP.SlotPos                = 73            -- Position in the slot
  178. SWEP.DrawAmmo               = true      -- Should draw the default HL2 ammo counter if enabled in the GUI.
  179. SWEP.DrawWeaponInfoBox          = false     -- Should draw the weapon info box
  180. SWEP.BounceWeaponIcon           =   false   -- Should the weapon icon bounce?
  181. SWEP.AutoSwitchTo           = true      -- Auto switch to if we pick it up
  182. SWEP.AutoSwitchFrom         = true      -- Auto switch from if you pick up a better weapon
  183. SWEP.Weight             = 30            -- This controls how "good" the weapon is for autopickup.
  184. SWEP.Type = "Assault Rifle"
  185. SWEP.DrawAmmo = false
  186.  
  187. --[[WEAPON HANDLING]]--
  188.  
  189. --Firing related
  190. SWEP.Primary.Sound          = Sound( "tazweapons/uzi_suppressed_fire1.wav" )            -- This is the sound of the weapon, when you shoot.
  191. SWEP.Primary.SilencedSound          = nil               -- This is the sound of the weapon, when silenced.
  192. SWEP.Primary.PenetrationMultiplier = 7 --Change the amount of something this gun can penetrate through
  193. SWEP.Primary.Damage     = 28                -- Damage, in standard damage points.
  194. SWEP.DamageType = nil--See DMG enum.  This might be DMG_SHOCK, DMG_BURN, DMG_BULLET, etc.
  195. SWEP.Primary.NumShots   = 1 --The number of shots the weapon fires.  SWEP.Shotgun is NOT required for this to be >1.
  196. SWEP.Primary.Automatic          = true              -- Automatic/Semi Auto
  197. SWEP.Primary.RPM                = 800                   -- This is in Rounds Per Minute / RPM
  198. SWEP.Primary.RPM_Semi               = 800                   -- RPM for semi-automatic or burst fire.  This is in Rounds Per Minute / RPM
  199. SWEP.FiresUnderwater = false
  200.  
  201. SWEP.CanBeSilenced = false --Can we silence?  Requires animations.
  202. SWEP.Silenced = false --Silenced by default?
  203.  
  204. -- Selective Fire Stuff
  205.  
  206. SWEP.SelectiveFire      = false --Allow selecting your firemode?
  207. SWEP.DisableBurstFire   = false --Only auto/single?
  208. SWEP.OnlyBurstFire      = false --No auto, only burst/single?
  209. SWEP.DefaultFireMode    = "auto" --Default to auto or whatev
  210. SWEP.FireModeName = nil --Change to a text value to override it
  211.  
  212. --Ammo Related
  213.  
  214. SWEP.Primary.ClipSize           = 30                -- This is the size of a clip
  215. SWEP.Primary.DefaultClip            = 0                 -- This is the number of bullets the gun gives you, counting a clip as defined directly above.
  216. SWEP.Primary.Ammo           = "ar2"                 -- What kind of ammo.  Options, besides custom, include pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, and AirboatGun.
  217. --Pistol, buckshot, and slam like to ricochet. Use AirboatGun for a light metal peircing shotgun pellets
  218.  
  219. SWEP.DisableChambering = false --Disable round-in-the-chamber
  220.  
  221. --Recoil Related
  222. SWEP.Primary.KickUp         = 0.62                  -- This is the maximum upwards recoil (rise)
  223. SWEP.Primary.KickDown           = 0.12                  -- This is the maximum downwards recoil (skeet)
  224. SWEP.Primary.KickHorizontal         = 0.32                  -- This is the maximum sideways recoil (no real term)
  225. SWEP.Primary.StaticRecoilFactor = 0.20  --Amount of recoil to directly apply to EyeAngles.  Enter what fraction or percentage (in decimal form) you want.  This is also affected by a convar that defaults to 0.5.
  226.  
  227. --Firing Cone Related
  228.  
  229. SWEP.Primary.Spread     = .028                  --This is hip-fire acuracy.  Less is more (1 is horribly awful, .0001 is close to perfect)
  230. SWEP.Primary.IronAccuracy = .022    -- Ironsight accuracy, should be the same for shotguns
  231.  
  232. --Unless you can do this manually, autodetect it.  If you decide to manually do these, uncomment this block and remove this line.
  233. --SWEP.Primary.SpreadMultiplierMax = 2.5 --How far the spread can expand when you shoot.
  234. --SWEP.Primary.SpreadIncrement = 1/3.5 --What percentage of the modifier is added on, per shot.
  235. --SWEP.Primary.SpreadRecovery = 3 --How much the spread recovers, per second.
  236.  
  237. --Range Related
  238. SWEP.Primary.Range = -1 -- The distance the bullet can travel in source units.  Set to -1 to autodetect based on damage/rpm.
  239. SWEP.Primary.RangeFalloff = -1 -- The percentage of the range the bullet damage starts to fall off at.  Set to 0.8, for example, to start falling off after 80% of the range.
  240.  
  241.  
  242. --Penetration Related
  243.  
  244. SWEP.MaxPenetrationCounter=4 --The maximum number of ricochets.  To prevent stack overflows.
  245.  
  246. --Misc
  247. SWEP.IronRecoilMultiplier=0.8 --Multiply recoil by this factor when we're in ironsights.  This is proportional, not inversely.
  248. SWEP.CrouchRecoilMultiplier=0.5  --Multiply recoil by this factor when we're crouching.  This is proportional, not inversely.
  249. SWEP.JumpRecoilMultiplier=1.3  --Multiply recoil by this factor when we're crouching.  This is proportional, not inversely.
  250. SWEP.WallRecoilMultiplier=1.1  --Multiply recoil by this factor when we're changing state e.g. not completely ironsighted.  This is proportional, not inversely.
  251. SWEP.ChangeStateRecoilMultiplier=1.3  --Multiply recoil by this factor when we're crouching.  This is proportional, not inversely.
  252. SWEP.CrouchAccuracyMultiplier=0.78--Less is more.  Accuracy * 0.5 = Twice as accurate, Accuracy * 0.1 = Ten times as accurate
  253. SWEP.ChangeStateAccuracyMultiplier=1.5 --Less is more.  A change of state is when we're in the progress of doing something, like crouching or ironsighting.  Accuracy * 2 = Half as accurate.  Accuracy * 5 = 1/5 as accurate
  254. SWEP.JumpAccuracyMultiplier=2--Less is more.  Accuracy * 2 = Half as accurate.  Accuracy * 5 = 1/5 as accurate
  255. SWEP.WalkAccuracyMultiplier=1.35--Less is more.  Accuracy * 2 = Half as accurate.  Accuracy * 5 = 1/5 as accurate
  256. SWEP.IronSightTime = 0.3 --The time to enter ironsights/exit it.
  257. SWEP.NearWallTime = 0.25 --The time to pull up  your weapon or put it back down
  258. SWEP.ToCrouchTime = 0.05 --The time it takes to enter crouching state
  259. SWEP.WeaponLength = 40 --Almost 3 feet Feet.  This should be how far the weapon sticks out from the player.  This is used for calculating the nearwall trace.
  260. SWEP.MoveSpeed = 0.92 --Multiply the player's movespeed by this.
  261. SWEP.IronSightsMoveSpeed = 0.75 --Multiply the player's movespeed by this when sighting.
  262. SWEP.SprintFOVOffset = 3.75 --Add this onto the FOV when we're sprinting.
  263.  
  264. --[[PROJECTILES]]--
  265.  
  266. SWEP.ProjectileEntity = nil --Entity to shoot
  267. SWEP.ProjectileVelocity = 0 --Entity to shoot's velocity
  268. SWEP.ProjectileModel = nil --Entity to shoot's model
  269.  
  270. --[[VIEWMODEL]]--
  271.  
  272. SWEP.ViewModel          = "models/tnb/weapons/c_m4.mdl" --Viewmodel path
  273. SWEP.ViewModelFOV           = 50        -- This controls how big the viewmodel looks.  Less is more.
  274. SWEP.ViewModelFlip          = false     -- Set this to true for CSS models, or false for everything else (with a righthanded viewmodel.)
  275. SWEP.MaterialTable = nil --Make sure the viewmodel and the worldmodel have the same material ids.  Next, fill this in with your desired submaterials.
  276. SWEP.UseHands = true --Use gmod c_arms system.
  277. SWEP.VMPos = Vector(0,0,0) --The viewmodel positional offset, constantly.  Subtract this from any other modifications to viewmodel position.
  278. SWEP.VMAng = Vector(0,0,0) --The viewmodel angular offset, constantly.   Subtract this from any other modifications to viewmodel angle.
  279.  
  280. --[[WORLDMODEL]]--
  281.  
  282. SWEP.WorldModel         = "models/tnb/weapons/w_m4.mdl" -- Weapon world model path
  283.  
  284. SWEP.HoldType               = "smg"     -- This is how others view you carrying the weapon. Options include:
  285. -- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive
  286. -- You're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles
  287.  
  288. SWEP.Offset = { --Procedural world model animation, defaulted for CS:S purposes.
  289.         Pos = {
  290.         Up = 0,
  291.         Right = 0,
  292.         Forward = 0,
  293.         },
  294.         Ang = {
  295.         Up = -1,
  296.         Right = -2,
  297.         Forward = 178
  298.         },
  299.         Scale = 1
  300. }
  301.  
  302. SWEP.ThirdPersonReloadDisable=false --Disable third person reload?  True disables.
  303.  
  304. --[[SCOPES]]--
  305.  
  306. SWEP.IronSightsSensitivity = 1 --Useful for a RT scope.  Change this to 0.25 for 25% sensitivity.  This is if normal FOV compenstaion isn't your thing for whatever reason, so don't change it for normal scopes.
  307. SWEP.BoltAction         = false  --Unscope/sight after you shoot?
  308. SWEP.Scoped             = false  --Draw a scope overlay?
  309.  
  310. SWEP.ScopeOverlayThreshold = 0.875 --Percentage you have to be sighted in to see the scope.
  311. SWEP.BoltTimerOffset = 0.25 --How long you stay sighted in after shooting, with a bolt action.
  312.  
  313. SWEP.ScopeScale = 0.5 --Scale of the scope overlay
  314. SWEP.ReticleScale = 0.7 --Scale of the reticle overlay
  315.  
  316. --GDCW Overlay Options.  Only choose one.
  317.  
  318. SWEP.Secondary.UseACOG          = false  --Overlay option
  319. SWEP.Secondary.UseMilDot            = false          --Overlay option
  320. SWEP.Secondary.UseSVD           = false      --Overlay option
  321. SWEP.Secondary.UseParabolic     = false      --Overlay option
  322. SWEP.Secondary.UseElcan         = false  --Overlay option
  323. SWEP.Secondary.UseGreenDuplex       = false      --Overlay option
  324.  
  325. --[[SHOTGUN CODE]]--
  326.  
  327. SWEP.Shotgun = false --Enable shotgun style reloading.
  328.  
  329. SWEP.ShellTime          = .35 -- For shotguns, how long it takes to insert a shell.
  330.  
  331. --[[SPRINTING]]--
  332.  
  333. SWEP.RunSightsPos = Vector(3.417, -2.814, -0.403)
  334. SWEP.RunSightsAng = Vector(-14.775, 43.618, -22.514)
  335.  
  336. --[[IRONSIGHTS]]--
  337.  
  338. SWEP.data               = {}
  339. SWEP.data.ironsights            = 1 --Enable Ironsights
  340. SWEP.Secondary.IronFOV          = 70                    -- How much you 'zoom' in. Less is more!  Don't have this be <= 0.  A good value for ironsights is like 70.
  341.  
  342. SWEP.IronSightsPos = Vector( -6.5743, 5, 1.5 )
  343. SWEP.IronSightsAng = Vector( -0.0134, -0.2382, -0.1757 )
  344.  
  345. --[[INSPECTION]]--
  346.  
  347. SWEP.InspectPos = nil --Replace with a vector, in style of ironsights position, to be used for inspection
  348. SWEP.InspectAng = nil --Replace with a vector, in style of ironsights angle, to be used for inspection
  349. SWEP.InspectionLoop = true --Setting false will cancel inspection once the animation is done.  CS:GO style.
  350.  
  351. --[[VIEWMODEL ANIMATION HANDLING]]--
  352.  
  353. SWEP.ShootWhileDraw=false --Can you shoot while draw anim plays?
  354. SWEP.AllowReloadWhileDraw=false --Can you w while draw anim plays?
  355. SWEP.SightWhileDraw=false --Can we sight in while the weapon is drawing / the draw anim plays?
  356. SWEP.AllowReloadWhileHolster=true --Can we interrupt holstering for reloading?
  357. SWEP.ShootWhileHolster=true --Cam we interrupt holstering for shooting?
  358. SWEP.SightWhileHolster=false --Cancel out "iron"sights when we holster?
  359. SWEP.UnSightOnReload=true --Cancel out ironsights for reloading.
  360. SWEP.AllowReloadWhileSprinting=false --Can you reload when close to a wall and facing it?
  361. SWEP.AllowReloadWhileNearWall=false --Can you reload when close to a wall and facing it?
  362. SWEP.SprintBobMult=1.5 -- More is more bobbing, proportionally.  This is multiplication, not addition.  You want to make this > 1 probably for sprinting.
  363. SWEP.IronBobMult=0  -- More is more bobbing, proportionally.  This is multiplication, not addition.  You want to make this < 1 for sighting, 0 to outright disable.
  364. SWEP.AllowViewAttachment = true --Allow the view to sway based on weapon attachment while reloading or drawing, IF THE CLIENT HAS IT ENABLED IN THEIR CONVARS!!!!11111oneONEELEVEN
  365.  
  366.  
  367. --[[VIEWMODEL BLOWBACK]]--
  368.  
  369. SWEP.BlowbackEnabled = false --Enable Blowback?
  370. SWEP.BlowbackVector = Vector(0,-1,0) --Vector to move bone <or root> relative to bone <or view> orientation.
  371. SWEP.BlowbackCurrentRoot = 0 --Amount of blowback currently, for root
  372. SWEP.BlowbackCurrent = 0 --Amount of blowback currently, for bones
  373. SWEP.BlowbackBoneMods = nil --Viewmodel bone mods via SWEP Creation Kit
  374. SWEP.Blowback_Only_Iron = true --Only do blowback on ironsights
  375. SWEP.Blowback_PistolMode = false --Do we recover from blowback when empty?
  376. SWEP.Blowback_Shell_Enabled = true
  377. SWEP.Blowback_Shell_Effect = "ShellEject"
  378.  
  379. --[[HOLDTYPES]]--
  380.  
  381. SWEP.IronSightHoldTypeOverride=""  --This variable overrides the ironsights holdtype, choosing it instead of something from the above tables.  Change it to "" to disable.
  382. SWEP.SprintHoldTypeOverride=""  --This variable overrides the sprint holdtype, choosing it instead of something from the above tables.  Change it to "" to disable.
  383.  
  384. --[[ANIMATION]]--
  385.  
  386. SWEP.ForceDryFireOff = true --Disables dryfire.  Set to false to enable them.
  387. SWEP.DisableIdleAnimations = true --Disables idle animations.  Set to false to enable them.
  388. SWEP.ForceEmptyFireOff = true --Disables empty fire animations.  Set to false to enable them.
  389.  
  390. --If you really want, you can remove things from SWEP.actlist and manually enable animations and set their lengths.
  391.  
  392. SWEP.SequenceEnabled = {} --Self explanitory.  This can forcefully enable or disable a certain ACT_VM
  393. SWEP.SequenceLength = {}  --This controls the length of a certain ACT_VM
  394. SWEP.SequenceLengthOverride={} --Override this if you want to change the length of a sequence but not the next idle
  395.  
  396. --[[EFFECTS]]--
  397.  
  398. --Muzzle Smoke
  399.  
  400. SWEP.SmokeParticles = { pistol = "smoke_trail_controlled",  --These are particle effects INSIDE a pcf file, not PCF files, that are played when you shoot.
  401.     smg = "smoke_trail_tfa",
  402.     grenade = "smoke_trail_tfa",
  403.     ar2 = "smoke_trail_tfa",
  404.     shotgun = "smoke_trail_wild",
  405.     rpg = "smoke_trail_tfa",
  406.     physgun = "smoke_trail_tfa",
  407.     crossbow = "smoke_trail_tfa",
  408.     melee = "smoke_trail_tfa",
  409.     slam = "smoke_trail_tfa",
  410.     normal = "smoke_trail_tfa",
  411.     melee2 = "smoke_trail_tfa",
  412.     knife = "smoke_trail_tfa",
  413.     duel = "smoke_trail_tfa",
  414.     camera = "smoke_trail_tfa",
  415.     magic = "smoke_trail_tfa",
  416.     revolver = "smoke_trail_tfa",
  417.     silenced = "smoke_trail_controlled"
  418. }
  419.  
  420. --Muzzle Flash
  421.  
  422. SWEP.MuzzleAttachment           = "1"       -- Should be "1" for CSS models or "muzzle" for hl2 models
  423. --SWEP.MuzzleAttachmentRaw = 1 --This will override whatever string you gave.  This is the raw attachment number.  This is overridden or created when a gun makes a muzzle event.
  424. SWEP.ShellAttachment            = "2"       -- Should be "2" for CSS models or "shell" for hl2 models
  425.  
  426. SWEP.DoMuzzleFlash = true --Do a muzzle flash?
  427. SWEP.CustomMuzzleFlash = true --Disable muzzle anim events and use our custom flashes?
  428. SWEP.AutoDetectMuzzleAttachment = true --For multi-barrel weapons, detect the proper attachment?
  429. SWEP.MuzzleFlashEffect = "tfa_muzzleflash_silenced" --Change to a string of your muzzle flash effect.  Copy/paste one of the existing from the base.
  430.  
  431. --Tracer Stuff
  432.  
  433. SWEP.Tracer             = 0     --Bullet tracer.  TracerName overrides this.
  434. SWEP.TracerName         = nil   --Change to a string of your tracer name.  Can be custom.
  435.                                 --There is a nice example at https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/base/entities/effects/tooltracer.lua
  436. SWEP.TracerCount        = 3     --0 disables, otherwise, 1 in X chance
  437.  
  438.  
  439. SWEP.TracerLua          = false --Use lua effect, TFA Muzzle syntax.  Currently obsolete.
  440. SWEP.TracerDelay        = 0.01 --Delay for lua tracer effect
  441.  
  442. --Impact Effects
  443.  
  444. SWEP.ImpactEffect = nil--Impact Effect
  445.  
  446. --[[EVENT TABLE]]--
  447.  
  448. SWEP.EventTable = {} --Event Table, used for custom events when an action is played.  This can even do stuff like playing a pump animation after shooting.
  449.  
  450. --example:
  451. --SWEP.EventTable = {
  452. --  [ACT_VM_RELOAD] = {
  453. --      { ['time'] = 0.1, ['type'] = "lua", ['value'] = examplefunction, ['client'] = true, ['server'] = false  },
  454. --      { ['time'] = 0.2, ['type'] = "sound", ['value'] = Sound("ExampleGun.Sound1", ['client'] = true, ['server'] = false ) }
  455. --  }
  456. --}
  457.  
  458.  
  459. --[[RENDER TARGET]]--
  460.  
  461. SWEP.RTMaterialOverride = nil -- Take the material you want out of print(LocalPlayer():GetViewModel():GetMaterials()), subtract 1 from its index, and set it to this.
  462.  
  463. SWEP.RTOpaque = false -- Do you want your render target to be opaque?
  464.  
  465. SWEP.RTCode = function( self ) --This is the function to draw onto your rendertarget
  466.  
  467.     return
  468.  
  469. end
  470.  
  471. --[[AKIMBO]]--
  472.  
  473. SWEP.Akimbo = false --Akimbo gun?  Alternates between primary and secondary attacks.
  474. SWEP.AnimCycle = 0 -- Start on the right
  475.  
  476. --[[TTT]]--
  477.  
  478. local gm = engine.ActiveGamemode()
  479. if string.find(gm,"ttt") or string.find(gm,"terrorist") then
  480.     SWEP.Kind = WEAPON_HEAVY
  481.     SWEP.AutoSpawnable = false
  482.     SWEP.AllowDrop = true
  483.     SWEP.AmmoEnt = "item_ammo_smg1_ttt"
  484. end
  485.  
  486.  
  487. --[[MISC INFO FOR MODELERS]]--
  488.  
  489. --[[
  490.  
  491. Used Animations (for modelers):
  492.  
  493. ACT_VM_DRAW - Draw
  494. ACT_VM_DRAW_EMPTY - Draw empty
  495. ACT_VM_DRAW_SILENCED - Draw silenced, overrides empty
  496.  
  497. ACT_VM_IDLE - Idle
  498. ACT_VM_IDLE_SILENCED - Idle empty, overwritten by silenced
  499. ACT_VM_IDLE_SILENCED - Idle silenced
  500.  
  501. ACT_VM_PRIMARYATTACK - Shoot
  502. ACT_VM_PRIMARYATTACK_EMPTY - Shoot last chambered bullet
  503. ACT_VM_PRIMARYATTACK_SILENCED - Shoot silenced, overrides empty
  504. ACT_VM_PRIMARYATTACK_1 - Shoot ironsights, overriden by everything besides normal shooting
  505. ACT_VM_DRYFIRE - Dryfire
  506.  
  507. ACT_VM_RELOAD - Reload / Tactical Reload / Insert Shotgun Shell
  508. ACT_SHOTGUN_RELOAD_START - Start shotgun reload, unless ACT_VM_RELOAD_EMPTY is there.
  509. ACT_SHOTGUN_RELOAD_FINISH - End shotgun reload.
  510. ACT_VM_RELOAD_EMPTY - Empty mag reload, chambers the new round.  Works for shotguns too, where applicable.
  511. ACT_VM_RELOAD_SILENCED - Silenced reload, overwrites all
  512.  
  513.  
  514. ACT_VM_HOLSTER - Holster
  515. ACT_VM_HOLSTER_SILENCED - Holster empty, overwritten by silenced
  516. ACT_VM_HOLSTER_SILENCED - Holster silenced
  517.  
  518. ]]--
  519.  
  520. --[[Stuff you SHOULD NOT touch after this]]--
  521.  
  522. --Allowed VAnimations.  These are autodetected, so not really needed except as an extra precaution.  Do NOT change these, unless absolutely necessary.
  523.  
  524. SWEP.CanDrawAnimate=true
  525. SWEP.CanDrawAnimateEmpty=false
  526. SWEP.CanDrawAnimateSilenced=false
  527. SWEP.CanHolsterAnimate=true
  528. SWEP.CanHolsterAnimateEmpty=false
  529. SWEP.CanIdleAnimate=true
  530. SWEP.CanIdleAnimateEmpty=false
  531. SWEP.CanIdleAnimateSilenced=false
  532. SWEP.CanShootAnimate=true
  533. SWEP.CanShootAnimateSilenced=false
  534. SWEP.CanReloadAnimate=true
  535. SWEP.CanReloadAnimateEmpty=false
  536. SWEP.CanReloadAnimateSilenced=false
  537. SWEP.CanDryFireAnimate=false
  538. SWEP.CanDryFireAnimateSilenced=false
  539. SWEP.CanSilencerAttachAnimate=false
  540. SWEP.CanSilencerDetachAnimate=false
  541.  
  542. --Misc
  543.  
  544. SWEP.ShouldDrawAmmoHUD=false--THIS IS PROCEDURALLY CHANGED AND SHOULD NOT BE TWEAKED.  BASE DEPENDENT VALUE.  DO NOT CHANGE OR THINGS MAY BREAK.  NO USE TO YOU.
  545. SWEP.DefaultFOV=90 --BASE DEPENDENT VALUE.  DO NOT CHANGE OR THINGS MAY BREAK.  NO USE TO YOU.
  546.  
  547. --Disable secondary crap
  548.  
  549. SWEP.Secondary.ClipSize         = 0                 -- Size of a clip
  550. SWEP.Secondary.DefaultClip          = 0                 -- Default ammo to give...
  551. SWEP.Secondary.Automatic            = false                 -- Automatic/Semi Auto
  552. SWEP.Secondary.Ammo         = "none" -- Self explanitory, ammo type.
  553.  
  554. --Convar support
  555.  
  556. SWEP.ConDamageMultiplier = 1
  557.  
  558. SWEP.Base               = "tfa_gun_base"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement