Hello,
i just added a ak-47 to my TTT server and it instant reloads does anyone know a fix for this?
i allready tryed alot of things but i cant get it fixed.
My lua file :
[CODE]---- Example TTT custom weapon
-- First some standard GMod stuff
if SERVER then
AddCSLuaFile( "shared.lua" )
end
if CLIENT then
SWEP.PrintName = "AK47"
SWEP.Slot = 2 -- add 1 to get the slot number key
SWEP.ViewModelFOV = 72
SWEP.ViewModelFlip = true
end
-- Always derive from weapon_tttbase.
SWEP.Base = "weapon_tttbase"
--- Standard GMod values
SWEP.HoldType = "ar2"
SWEP.Primary.Delay = 0.08
SWEP.Primary.Recoil = 1.9
SWEP.Primary.Automatic = true
SWEP.Primary.Damage = 20
SWEP.Primary.Cone = 0.025
SWEP.Primary.Ammo = "smg1"
SWEP.Primary.ClipSize = 30
SWEP.Primary.ClipMax = 90
SWEP.Primary.DefaultClip = 30
SWEP.Primary.Sound = Sound( "Weapon_AK47.Single" )
SWEP.IronSightsPos = Vector( 6.05, -5, 2.4 )
SWEP.IronSightsAng = Vector( 2.2, -0.1, 0 )
SWEP.ViewModel = "models/weapons/v_rif_ak47.mdl"
SWEP.WorldModel = "models/weapons/w_rif_ak47.mdl"
--- TTT config values
-- Kind specifies the category this weapon is in. Players can only carry one of
-- each. Can be: WEAPON_... MELEE, PISTOL, HEAVY, NADE, CARRY, EQUIP1, EQUIP2 or ROLE.
-- Matching SWEP.Slot values: 0 1 2 3 4 6 7 8
SWEP.Kind = WEAPON_HEAVY
-- If AutoSpawnable is true and SWEP.Kind is not WEAPON_EQUIP1/2, then this gun can
-- be spawned as a random weapon. Of course this AK is special equipment so it won't,
-- but for the sake of example this is explicitly set to false anyway.
SWEP.AutoSpawnable = true
-- The AmmoEnt is the ammo entity that can be picked up when carrying this gun.
SWEP.AmmoEnt = "item_ammo_smg1_ttt"
-- If IsSilent is true, victims will not scream upon death.
SWEP.IsSilent = false
-- If NoSights is true, the weapon won't have ironsights
SWEP.NoSights = false
resource.AddFile("models/weapons/w_rif_ak47.mdl")
resource.AddFile("models/weapons/v_rif_ak47.mdl")
[/CODE]
PS : im new to the coding stuff :S
Your server doesn't have the model. I suggest you switch to the c_rif_ak47.mdl for custom hands and stuff.
I've had a problem with that on my server and putting
[lua] SWEP:Reload()
self.SendWeaponAnim( ACT_VM_RELOAD )
end [/lua]
worked for me. Not sure about the SendWeaponAnim function, don't have access to my code right noe because of computer probles.
What this does is manually calls the reload animation from inside the weapon
[lua]function SWEP:Reload()
self.Weapon:DefaultReload(self.ReloadAnim)
self:SetIronsights( false )
end[/lua]
weapon_tttbase lines 371-374. This shouldn't be a problem.
I had the same problem with all my weapons. it was an error with CSS and not being mounted correctly. If you need a link google "CSS content for gmod" and there is a website called moddb with a download link to the CORRECT css content. Put it in garrysmod>garrysmod>cstrike. Then go into the folder CFG and open mount.cfg in an editing program such as notepad++. and un comment cstrike and change the path go garrysmod>garrysmod>cstrike
[QUOTE=Robotboy655;42853208]Your server doesn't have the model. I suggest you switch to the c_rif_ak47.mdl for custom hands and stuff.[/QUOTE]
So that's why the model was strange in my server and sometimes made the instant reload too? Thank you!
Sorry, you need to Log In to post a reply to this thread.