• Swep disapearing
    9 replies, posted
I made a P99 in madcow base, it work perfectly with the silencer but when I remove it the weapon is moving out of my screen. I come back where it suppost to be when I fire and goes back out of the screen. Any Idea why? Btw how do I fix this: [img]http://img130.imageshack.us/img130/7769/hl22010040307180903.png[/img] [img]http://img196.imageshack.us/img196/9117/hl22010040307175677.png[/img] [img]http://img214.imageshack.us/img214/4528/hl22010040307175712.png[/img] [code]// Variables that are used on both client and server SWEP.Base = "weapon_mad_base" SWEP.ViewModelFOV = 70 SWEP.ViewModelFlip = true SWEP.ViewModel = "models/weapons/v_pist_p99.mdl" SWEP.WorldModel = "models/weapons/w_pist_p99.mdl" SWEP.Spawnable = true SWEP.AdminSpawnable = false SWEP.Primary.Sound = Sound("weapons/p99/usp_unsil-1.wav") SWEP.Primary.SuppressorSound = Sound("weapons/p99/usp1.wav") SWEP.Primary.NoSuppressorSound= Sound("weapons/p99/usp_unsil-1.wav") SWEP.Primary.Recoil = 1.25 SWEP.Primary.Damage = 25 SWEP.Primary.NumShots = 1 SWEP.Primary.Cone = 0 SWEP.Primary.Delay = 0.0 SWEP.Primary.ClipSize = 21 // Size of a clip SWEP.Primary.DefaultClip = 21 // Default number of bullets in a clip SWEP.Primary.Automatic = false // Automatic/Semi Auto SWEP.Primary.Ammo = "Battery" SWEP.Secondary.ClipSize = -1 // Size of a clip SWEP.Secondary.DefaultClip = -1 // Default number of bullets in a clip SWEP.Secondary.Automatic = false // Automatic/Semi Auto SWEP.Secondary.Ammo = "none" SWEP.ShellEffect = "effect_mad_shell_pistol" // "effect_mad_shell_pistol" or "effect_mad_shell_rifle" or "effect_mad_shell_shotgun" SWEP.ShellDelay = 0.05 SWEP.Pistol = true SWEP.Rifle = false SWEP.Shotgun = false SWEP.Sniper = false SWEP.IronSightsPos = Vector (1.9026, 0, 1.0528) SWEP.IronSightsAng = Vector (0.2222, -0.1273, 0) SWEP.Type = 2 SWEP.Mode = true SWEP.data = {} SWEP.data.NormalMsg = "" SWEP.data.ModeMsg = "" SWEP.data.Delay = 3 SWEP.data.Cone = 1.5 SWEP.data.Damage = 0.75 SWEP.data.Recoil = 0.5 /*--------------------------------------------------------- Name: SWEP:Precache() Desc: Use this function to precache stuff. ---------------------------------------------------------*/ function SWEP:Precache() util.PrecacheSound("weapons/usp/usp1.wav") end /*--------------------------------------------------------- Name: SWEP:ShootAnimation() ---------------------------------------------------------*/ function SWEP:ShootAnimation() if (self.Weapon:Clip1() <= 0) then if self.Weapon:GetDTBool(3) and self.Type == 2 then self.Weapon:SendWeaponAnim(ACT_VM_DRYFIRE_SILENCED) // View model animation else self.Weapon:SendWeaponAnim(ACT_VM_DRYFIRE) // View model animation end else if self.Weapon:GetDTBool(3) and self.Type == 2 then self.Weapon:SendWeaponAnim(ACT_VM_IDLE) local Animation = self.Owner:GetViewModel() Animation:SetSequence(Animation:LookupSequence("shoot1")) else self.Weapon:SendWeaponAnim(ACT_VM_PRIMARYATTACK) // View model animation end end end[/code]
You have put the vectors in your swep wrong, so basicly your moving the weapon out of the screen becuse you told it to. Like this is probbably pretty wrong: SWEP.IronSightsPos = Vector (1.9026, 0, 1.0528) SWEP.IronSightsAng = Vector (0.2222, -0.1273, 0)
[QUOTE=Tobba;21138844]You have put the vectors in your swep wrong, so basicly your moving the weapon out of the screen becuse you told it to. Like this is probbably pretty wrong: SWEP.IronSightsPos = Vector (1.9026, 0, 1.0528) SWEP.IronSightsAng = Vector (0.2222, -0.1273, 0)[/QUOTE] No, no, no If he was going into ironsights and it was doing that then yes..but no. [editline]09:07PM[/editline] Its weird because I have this prob with my physgun reskin :/
[QUOTE=Tobba;21138844]You have put the vectors in your swep wrong, so basicly your moving the weapon out of the screen becuse you told it to. Like this is probbably pretty wrong: SWEP.IronSightsPos = Vector (1.9026, 0, 1.0528) SWEP.IronSightsAng = Vector (0.2222, -0.1273, 0)[/QUOTE] SWEP.IronSightsPos = Vector (1.9026, 0, 1.0528) SWEP.IronSightsAng = Vector (0, 0, 0) is that better? EDIT: Doesn't work worshipper need to see this.
[QUOTE=beat the zombie;21150223]SWEP.IronSightsPos = Vector (1.9026, 0, 1.0528) SWEP.IronSightsAng = Vector (0, 0, 0) is that better? EDIT: Doesn't work worshipper need to see this.[/QUOTE] I am thinking it's because you didn't use function Primary Attack in your code, try it if not read part 2. prt2, give us the soucecode for madcows base code.
[QUOTE=Cubar;21155926]I am thinking it's because you didn't use function Primary Attack in your code, try it if not read part 2. prt2, give us the soucecode for madcows base code.[/QUOTE] Can you show me how to do the attack code?
Seems like you missed some lines about the running angles too, atleast i had that in mine
Can anyone fix this. I know it's not the base cause I amde a Vector and a Glock 19. [url]http://www.garrysmod.org/downloads/?a=view&id=95369[/url]
[QUOTE=beat the zombie;21161779]Can anyone fix this. I know it's not the base cause I amde a Vector and a Glock 19. [url]http://www.garrysmod.org/downloads/?a=view&id=95369[/url][/QUOTE] Care, to share?
[QUOTE=Cubar;21164546]Care, to share?[/QUOTE] I'm going to upload it. EDIT: Done [url]http://www.garrysmod.org/downloads/?a=view&id=95417[/url]
Sorry, you need to Log In to post a reply to this thread.