• TTT MP7 reload glitch
    5 replies, posted
Hey i added a MP7 to my TTT server, and it dosent have a reload animation and reloads instantly. The animation when you switch is missing too Can someone help me? [QUOTE]if SERVER then resource.AddFile( "weapons/v_mp7_silenced.mdl" ) resource.AddFile( "weapons/w_mp7_silenced.mdl" ) resource.AddFile( "sound/weapons/mp7/mp7_reload.wav" ) resource.AddFile( "sound/weapons/mp7/mp7_fire.wav" ) AddCSLuaFile( "shared.lua" ) end SWEP.HoldType = "smg" if CLIENT then SWEP.PrintName = "H&K MP7" SWEP.Author = "Assassin" SWEP.Slot = 2 SWEP.SlotPos = 0 SWEP.Icon = "materials/vgui/weapon_real_cs_aug.vmt" SWEP.ViewModelFlip = true end SWEP.Base = "weapon_tttbase" SWEP.Spawnable = false SWEP.AdminSpawnable = false SWEP.Kind = WEAPON_HEAVY SWEP.Primary.Damage = 11 SWEP.Primary.Delay = 0.045 SWEP.Primary.Cone = 0.01 SWEP.Primary.ClipSize = 40 SWEP.Primary.ClipMax = 80 SWEP.Primary.DefaultClip = 40 SWEP.Primary.Automatic = true SWEP.Primary.Ammo = "smg1" SWEP.AutoSpawnable = false SWEP.Primary.Recoil = 0.8 SWEP.Primary.Sound = Sound("weapons/mp7/mp7_fire.wav") SWEP.ViewModel = "models/weapons/v_mp7_silenced.mdl" SWEP.WorldModel = "models/weapons/w_mp7_silenced.mdl" SWEP.AmmoEnt = "item_ammo_smg1_ttt" SWEP.HeadshotMultiplier = 2.2 SWEP.Secondary.Sound = Sound("Default.Zoom") SWEP.IsSilent = true SWEP.IronSightsPos = Vector( 5, -15, -2 ) SWEP.IronSightsAng = Vector( 2.6, 1.37, 3.5 ) function SWEP:SetZoom(state) if CLIENT then return else if state then self.Owner:SetFOV(20, 0.3) else self.Owner:SetFOV(0, 0.2) end end end -- Add some zoom to ironsights for this gun function SWEP:SecondaryAttack() if not self.IronSightsPos then return end if self.Weapon:GetNextSecondaryFire() > CurTime() then return end bIronsights = not self:GetIronsights() self:SetIronsights( bIronsights ) if SERVER then self:SetZoom(bIronsights) else self:EmitSound(self.Secondary.Sound) end self.Weapon:SetNextSecondaryFire( CurTime() + 0.3) end function SWEP:PreDrop() self:SetZoom(false) self:SetIronsights(false) return self.BaseClass.PreDrop(self) end function SWEP:Reload() self.Weapon:DefaultReload( ACT_VM_RELOAD ); self:SetIronsights( false ) self:SetZoom(false) self.Weapon:SetNetworkedBool("Reloading", true) self.Weapon:EmitSound("weapons/mp7/mp7_reload.wav") end function SWEP:Holster() self:SetIronsights(false) self:SetZoom(false) return true end if CLIENT then local scope = surface.GetTextureID("sprites/scope") function SWEP:DrawHUD() if self:GetIronsights() then surface.SetDrawColor( 0, 0, 0, 255 ) local x = ScrW() / 2.0 local y = ScrH() / 2.0 local scope_size = ScrH() -- crosshair local gap = 80 local length = scope_size surface.DrawLine( x - length, y, x - gap, y ) surface.DrawLine( x + length, y, x + gap, y ) surface.DrawLine( x, y - length, x, y - gap ) surface.DrawLine( x, y + length, x, y + gap ) gap = 0 length = 50 surface.DrawLine( x - length, y, x - gap, y ) surface.DrawLine( x + length, y, x + gap, y ) surface.DrawLine( x, y - length, x, y - gap ) surface.DrawLine( x, y + length, x, y + gap ) -- cover edges local sh = scope_size / 2 local w = (x - sh) + 2 surface.DrawRect(0, 0, w, scope_size) surface.DrawRect(x + sh - 2, 0, w, scope_size) surface.SetDrawColor(255, 0, 0, 255) surface.DrawLine(x, y, x + 1, y + 1) -- scope surface.SetTexture(scope) surface.SetDrawColor(255, 255, 255, 255) surface.DrawTexturedRectRotated(x, y, scope_size, scope_size, 0) else return self.BaseClass.DrawHUD(self) end end function SWEP:AdjustMouseSensitivity() return (self:GetIronsights() and 0.2) or nil end end[/QUOTE]
I know you! Ah. Icemod. Thats where. Now that I know who you are I dont want to help anymore. EDIT: Since I'm not a dick, I'll help you IF you PM me the entire addon (model+code) so I can test it locally.
[URL="http://facepunch.com/showthread.php?t=1238474"]MP7 from here[/URL] cant find PM button xD
The guy who made your cute little pack is an idiot, hence the animations missing. Nothing to do about that.
can i use the M16 reload animation for it? and if yes, how
Considering the animation is most likely hard-coded into the model, no.
Sorry, you need to Log In to post a reply to this thread.