• Swep models invisible to client but models Download
    1 replies, posted
Hey there! Quick question. I am working on a gamemode, and when people join, they download the models and textures fine, but when they are ingame, the models are invisible to them. Could i have forgotten to include something in the swep's lua? here is the code of one of them: [code] -- Read the weapon_real_base if you really want to know what each action does if (SERVER) then AddCSLuaFile("shared.lua") end SWEP.HoldType = "pistol" if (CLIENT) then SWEP.PrintName = "1911" SWEP.ViewModelFOV = 70 SWEP.Slot = 1 SWEP.SlotPos = 1 SWEP.IconLetter = "c" killicon.AddFont("weapon_real_cs_glock18", "CSKillIcons", SWEP.IconLetter, Color( 255, 80, 0, 255 )) end SWEP.Instructions = "Shoot to shoot" SWEP.Base = "weapon_real_base_pistol" SWEP.Spawnable = true SWEP.AdminSpawnable = true SWEP.HoldType = "pistol" SWEP.ViewModelFOV = 70 SWEP.ViewModelFlip = true SWEP.ViewModel = "models/weapons/v_pist_glock18.mdl" SWEP.WorldModel = "models/weapons/w_pist_glock18.mdl" SWEP.ShowViewModel = true SWEP.ShowWorldModel = true SWEP.ViewModelBoneMods = { ["v_weapon.Glock_Slide"] = { scale = Vector(0.009, 0.009, 0.009), pos = Vector(0, 0, 0), angle = Angle(0, 0, 0) }, ["v_weapon"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, 1.519), angle = Angle(0, 0, 3) }, ["v_weapon.Glock_Parent"] = { scale = Vector(0.009, 0.009, 0.009), pos = Vector(0, 0, 0), angle = Angle(0, 0, 0) } } SWEP.VElements = { ["FC3191+++"] = { type = "Model", model = "models/props/fc3191T.mdl", bone = "v_weapon.Glock_Parent", rel = "", pos = Vector(-0.75, 2.964, -0.455), angle = Angle(-9.551, -70.569, 90), size = Vector(10, 10, 10), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }, ["FC3191++"] = { type = "Model", model = "models/props/fc3191C.mdl", bone = "v_weapon.Glock_Clip", rel = "", pos = Vector(3.30, 0.054, -0.153), angle = Angle(0, -160.648, 90), size = Vector(10, 10, 10), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }, ["FC3191+"] = { type = "Model", model = "models/props/fc3191.mdl", bone = "v_weapon.Glock_Parent", rel = "", pos = Vector(2.994, -1.025, -0.029), angle = Angle(-9.551, -70.569, 90), size = Vector(10, 10, 10), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} } } SWEP.Category = "Far Cry 3" SWEP.Primary.Sound = Sound("FC3/1911-1.wav") SWEP.Primary.Recoil = 1.5 SWEP.Primary.Damage = 12 SWEP.Primary.NumShots = 1 SWEP.Primary.Cone = 0.015 SWEP.Primary.ClipSize = 8 SWEP.Primary.Delay = 0.1 SWEP.Primary.DefaultClip = 120 SWEP.Primary.Automatic = false SWEP.Primary.Ammo = "pistol" SWEP.Secondary.ClipSize = -1 SWEP.Secondary.DefaultClip = -1 SWEP.Secondary.Automatic = false SWEP.Secondary.Ammo = "none" SWEP.IronSightsPos = Vector(3.66, 0, 1.799) SWEP.IronSightsAng = Vector(0.555, -3.089, 1.085) SWEP.data = {} SWEP.mode = "semi" SWEP.data.newclip = false SWEP.data.zoomfov = 70 SWEP.data.snipefov = 0 SWEP.data.semi = {} SWEP.data.semi.Cone = 0.015 SWEP.data.burst = {} SWEP.data.burst.Delay = .34 SWEP.data.burst.Cone = 0.05 SWEP.data.burst.BurstDelay = .05 SWEP.data.burst.Shots = 3 SWEP.data.burst.Counter = 0 SWEP.data.burst.Timer = 0 /*--------------------------------------------------------- Auto/Semi Configuration ---------------------------------------------------------*/ function SWEP.data.burst.Init(self) self.Primary.Automatic = false self.Weapon:EmitSound("weapons/smg1/switch_burst.wav") end function SWEP:Deploy() self.Weapon:EmitSound("FC3/weapon_deploy.wav") self.Weapon:SendWeaponAnim( ACT_VM_DRAW ) -- Set the deploy animation when deploying self.Reloadaftershoot = CurTime() + 1 -- Can't shoot while deploying self:SetIronsights(false) -- Set the ironsight mod to false self.Weapon:SetNextPrimaryFire(CurTime() + 1) -- Set the next primary fire to 1 second after deploying return true end /*--------------------------------------------------------- PrimaryAttack ---------------------------------------------------------*/ function SWEP:PrimaryAttack() if not self:CanPrimaryAttack() or self.Owner:WaterLevel() > 1 or self.Owner:KeyDown(IN_SPEED) then return end -- If your gun have a problem or if you are under water, you'll not be able to fire self.Reloadaftershoot = CurTime() + self.Primary.Delay -- Set the reload after shoot to be not able to reload when firering self.Weapon:SetNextSecondaryFire(CurTime() + self.Primary.Delay) -- Set next secondary fire after your fire delay self.Weapon:SetNextPrimaryFire(CurTime() + self.Primary.Delay) -- Set next primary fire after your fire delay if self.mode == "burst" then self.data.burst.Timer = CurTime() self.Weapon:SetNextPrimaryFire(CurTime() + 0.5) self.data.burst.Counter = self.data.burst.Shots - 1 end self.Weapon:EmitSound(self.Primary.Sound) -- Emit the gun sound when you fire if (self:GetIronsights() == true) then self:CSShootBullet(self.Primary.Damage, 0, self.Primary.NumShots, self.Primary.Cone) -- Put 0 recoil when you're in ironsight mod self.Owner:ViewPunch(Angle(math.Rand(-0.5,-2.5) * (self.Primary.Recoil / 2), math.Rand(-1,1) * (self.Primary.Recoil / 2), 0)) -- Punch the screen 2x less hard when you're in ironsigh mod else self:CSShootBullet(self.Primary.Damage, self.Primary.Recoil, self.Primary.NumShots, self.Primary.Cone) -- Put normal recoil when you're not in ironsight mod self.Owner:ViewPunch(Angle(math.Rand(-0.5,-2.5) * self.Primary.Recoil, math.Rand(-1,1) *self.Primary.Recoil, 0)) -- Punch the screen end self:TakePrimaryAmmo(1) -- Take 1 ammo in you clip if ((game.SinglePlayer() and SERVER) or CLIENT) then self.Weapon:SetNetworkedFloat("LastShootTime", CurTime()) end end function SWEP:SecondaryAttack() if self.Owner:KeyDown(IN_USE) then end end function SWEP:Think() if self.Owner:KeyDown(IN_SPEED) then self:SetIronsights(false) self.Owner:SetFOV( 0, 0.15 ) end if self.data.init then self.Weapon:SetClip1( self.Weapon:Clip1() - 1 ) self.data.init = nil end if self.mode == "burst" then if self.data.burst.Timer + self.data.burst.BurstDelay < CurTime() then if self.data.burst.Counter > 0 then self.data.burst.Counter = self.data.burst.Counter - 1 self.data.burst.Timer = CurTime() if self:CanPrimaryAttack() then self.Weapon:EmitSound(self.Primary.Sound) if self.Owner:GetFOV() == 0 then --self:ShootBullet( 1, 1, self.data[self.mode].Cone ) self:CSShootBullet( self.Primary.Damage, self.Primary.Recoil, self.Primary.NumShots, self.data[self.mode].Cone ) else --self:ShootBullet( 1, 1, self.data[self.mode].Cone ) self:CSShootBullet( self.Primary.Damage, 0, self.Primary.NumShots, self.data[self.mode].Cone ) end self:TakePrimaryAmmo( 1 ) end end end end if self.data.newclip then if self.data.newclip == 0 then self.data.newclip = false if self:Ammo1() > self.Primary.ClipSize - 1 then if self.data.oldclip == 0 then self.Weapon:SetClip1( self.Weapon:Clip1() - 1 ) if SERVER then self.Owner:GiveAmmo(1,self.Primary.Ammo,true) end end end else self.data.newclip = self.data.newclip - 1 end end if !self.Owner:KeyDown(IN_USE) then if self.Owner:KeyPressed(IN_ATTACK2) then self:SetIronsights(true) self.Owner:SetFOV( 70, 0.15 ) self.Owner:SetNetworkedInt("ScopeLevel", 1) self.CrosshairColor = Color( 0, 0, 0, 0 ) if CLIENT then return end end end if self.Owner:KeyReleased(IN_ATTACK2) then self:SetIronsights(false) self.Owner:SetFOV( 0, 0.15 ) self.Owner:SetNetworkedInt("ScopeLevel", 0) self.CrosshairColor = Color( 0, 255, 0, 255 ) if CLIENT then return end end end function SWEP:Reload() if ( self.Reloadaftershoot > CurTime() ) then return end -- If you're f
What's your sv_downloadurl ?
Sorry, you need to Log In to post a reply to this thread.