i have a glitch with zoeys old L4D2 pack and it just missing just the arms.
and here is the error i get all the time
[addons\zoeys l4d2 sweps\lua\weapons\l4d2_base\shared.lua:35] attempt to index field 'Arms' (a nil value)
[addons\zoeys l4d2 sweps\lua\weapons\l4d2_base\shared.lua:20] ClientsideModel cannot be called while rendering
Any clues?
Would probably help to post what code is within l2d2_base\shared.lua.
l2d2_bas/shared.lua. where is that?
If you find the addon which you installed and navigate to zoeys l4d2 swep -> lua -> weapons -> l4d2_base -> shared.lua
kk found that what now i all ready have notepad+ so any code that can fix it here ill post it
[editline]15th January 2011[/editline]
35 - self.Arms:SetPos(self.Owner:GetViewModel():GetPos())
20 - self.Arms = ClientsideModel("models/weapons/arms/v_arms_coach_new.mdl")
Probably best to post all of the code, since the errors will likely lie in self.Arms
kk but do u mind that i do it withou the numbers?
just do [lua] tags either side of the pasted code (/lua on the last tag).
it is [lau]
[QUOTE=Rmk123;27421465]it is [lau][/QUOTE]
It's lua, not lau.
Here it is
CreateConVar( "l4d2_adminonly", 0, { FCVAR_REPLICATED, FCVAR_ARCHIVE } )
CreateConVar( "l4d2_infinite_pistol_ammo", 0, { FCVAR_REPLICATED, FCVAR_ARCHIVE } )
CreateConVar( "l4d2_real_clips", 0, { FCVAR_REPLICATED, FCVAR_ARCHIVE } )
CreateConVar( "l4d2_desertrifle_isauto", 0, { FCVAR_REPLICATED, FCVAR_ARCHIVE } )
if (CLIENT) then
surface.CreateFont("cs", ScrW()/3, ScrH()/3, true, true, "CSHIcon")
surface.CreateFont("HalfLife2", ScrW()/3, ScrH()/3, true, true, "Hl2HUD")
surface.CreateFont("HL2MP", ScrW()/3, ScrH()/3, true, true, "HL2KC")
end
function SWEP:ValidateArms() -- Hey zoey here, just to say that im updating my tf2 code so these pricks can steal it AGAIN...
self:CheckArms()
-- Oh look at this, this isnt something azadouche had, Real time arm changing, AND ITS CLIENT SIDE.
if self.Owner:GetNWInt("l4d2_character") == "nick" then
self.Arms = ClientsideModel("models/weapons/arms/v_arms_gambler_new.mdl")
elseif self.Owner:GetNWInt("l4d2_character") == "ellis" then
self.Arms = ClientsideModel("models/weapons/arms/v_arms_mechanic_new.mdl")
elseif self.Owner:GetNWInt("l4d2_character") == "coach" then
self.Arms = ClientsideModel("models/weapons/arms/v_arms_coach_new.mdl")
elseif self.Owner:GetNWInt("l4d2_character") == "rochelle" then
self.Arms = ClientsideModel("models/weapons/arms/v_arms_producer_new.mdl")
elseif self.Owner:GetNWInt("l4d2_character") == "bill" then
self.Arms = ClientsideModel("models/weapons/arms/v_arms_bill.mdl")
elseif self.Owner:GetNWInt("l4d2_character") == "francis" then
self.Arms = ClientsideModel("models/weapons/arms/v_arms_francis.mdl")
elseif self.Owner:GetNWInt("l4d2_character") == "louis" then
self.Arms = ClientsideModel("models/weapons/arms/v_arms_louis.mdl")
elseif self.Owner:GetNWInt("l4d2_character") == "zoey" then
self.Arms = ClientsideModel("models/weapons/arms/v_arms_zoey.mdl")
else
self.Arms = ClientsideModel("models/weapons/arms/v_arms_gambler_new.mdl")
end
-- Hey zoey again, Just taking the model where using and merging it with our v_model.
self.Arms:SetPos(self.Owner:GetViewModel():GetPos())
self.Arms:SetAngles(self.Owner:GetViewModel():GetAngles())
self.Arms:AddEffects(EF_BONEMERGE)
self.Arms:SetNoDraw(false)
self.Arms:SetParent(self.Owner:GetViewModel())
end
function SWEP:ViewModelDrawn()
if not self.Arms then self:ValidateArms() end
if self.Arms then self.Arms:DrawModel() end
if LocalPlayer():GetActiveWeapon():GetNWBool("ArmsReset") then
self.Arms:Remove()
self:ValidateArms()
end
end
function SWEP:SetDeploySpeed( speed )
self.m_WeaponDeploySpeed = 1
end
function SWEP:SpecialDeploy()
if not self:GetNWBool("ReDeployed") then
if self.Owner:Crouching() then
self:SetNWInt("ConeX",2)
else
self:SetNWInt("ConeX",1)
end
self:SetNWBool("ItemEX",false)
self:EmitSound(self.DrawSound)
self.Melee = nil
self:SetNWBool("ReDeployed",true)
self:Deploy()
end
end
function SWEP:BaseHolster()
self:StopSmoke()
self:SetNWBool("ReDeployed",false)
self.Owner:SetNWInt("LastWeapon", tostring(self:GetClass()))
if self:GetNWBool("Iron") then
self.Owner:SetFOV( 0, 0.2 )
end
return true
end
if (CLIENT) then
surface.CreateFont("cs", ScrW()/3, ScrH()/3, true, true, "CSHIcon")
surface.CreateFont("HalfLife2", ScrW()/3, ScrH()/3, true, true, "Hl2HUD")
end
local PistolWeaponSet = {
"l4d2_deserteagle",
"l4d2_pistol",
"l4d2_dualpistol"}
function SWEP:UnloadWeapon()
self.Unload = nil
if self:Clip1() <= 0 then return false end
if table.HasValue(PistolWeaponSet, self:GetClass()) and GetConVarNumber("l4d2_infinite_pistol_ammo") == 1 then return false end
if (SERVER) then
self.Owner:GiveAmmo( self:Clip1()-1, self.Primary.Ammo, true )
end
self:SetClip1(1)
end
function SWEP:Reloadgun()
self.DoReload = nil
local start = self:Clip1()
local taken = math.min( self.Primary.ClipSize, self.Primary.ClipSize - start, self.Owner:GetAmmoCount( self.Primary.Ammo ) )
if self:GetNWInt("FireBullet") > 0 and self:GetNWInt("FireBullet") <= self.Primary.ClipSize then
if self:Clip1() > 0 then
self:SetClip1(self:Clip1() + self:GetNWInt("FireBullet") -1)
self.Owner:RemoveAmmo( self:GetNWInt("FireBullet") - 1, self:GetPrimaryAmmoType() )
if self:Clip1() > self.Primary.ClipSize then self:SetClip1(self.Primary.ClipSize) end
else
self:SetClip1(self:Clip1() + self:GetNWInt("FireBullet"))
self.Owner:RemoveAmmo( self:GetNWInt("FireBullet"), self:GetPrimaryAmmoType() )
if self:Clip1() > self.Primary.ClipSize then self:SetClip1(self.Primary.ClipSize) end
end
elseif self:GetNWInt("ExplodeBullet") > 0 and self:GetNWInt("ExplodeBullet") <= self.Primary.ClipSize then
if self:Clip1() > 0 then
self:SetClip1(self:Clip1() + self:GetNWInt("ExplodeBullet") -1)
self.Owner:RemoveAmmo( self:GetNWInt("ExplodeBullet") - 1, self:GetPrimaryAmmoType() )
if self:Clip1() > self.Primary.ClipSize then self:SetClip1(self.Primary.ClipSize) end
else
self:SetClip1(self:Clip1() + self:GetNWInt("ExplodeBullet"))
self.Owner:RemoveAmmo( self:GetNWInt("ExplodeBullet"), self:GetPrimaryAmmoType() )
if self:Clip1() > self.Primary.ClipSize then self:SetClip1(self.Primary.ClipSize) end
end
else
self:SetClip1(self:Clip1() + taken)
if table.HasValue(PistolWeaponSet, self:GetClass()) and GetConVarNumber("l4d2_infinite_pistol_ammo") == 1 then return false end
self.Owner:RemoveAmmo( taken , self:GetPrimaryAmmoType() )
if self:Clip1() > self.Primary.ClipSize then self:SetClip1(self.Primary.ClipSize) end
end
end
SWEP.Primary.Smokey = "sidearm_smoke"
SWEP.Primary.Muzzle = "muzzle_pistols"
PrecacheParticleSystem("sidearm_smoke")
PrecacheParticleSystem("muzzle_pistols")
PrecacheParticleSystem("muzzle_rifles")
PrecacheParticleSystem("muzzle_mg42")
PrecacheParticleSystem("muzzle_rockets")
/*---------------------------------------------------------
Sensibility
---------------------------------------------------------*/
local LastViewAng = false
local function SimilarizeAngles (ang1, ang2)
ang1.y = math.fmod (ang1.y, 360)
ang2.y = math.fmod (ang2.y, 360)
if math.abs (ang1.y - ang2.y) > 180 then
if ang1.y - ang2.y < 0 then
ang1.y = ang1.y + 360
else
ang1.y = ang1.y - 360
end
end
end
local function ReduceScopeSensitivity (uCmd)
if LocalPlayer():GetActiveWeapon() and LocalPlayer():GetActiveWeapon():IsValid() then
local newAng = uCmd:GetViewAngles()
if LastViewAng then
SimilarizeAngles (LastViewAng, newAng)
local diff = newAng - LastViewAng
diff = diff * (LocalPlayer():GetActiveWeapon().MouseSensitivity or 1)
uCmd:SetViewAngles (LastViewAng + diff)
end
end
LastViewAng = uCmd:GetViewAngles()
end
hook.Add ("CreateMove", "RSS", ReduceScopeSensitivity)
function SWEP:DrawWorldModel()
local hand, offset, rotate
if not ValidEntity(self.Owner) then
self:DrawModel()
return
end
hand = self.Owner:GetAttachment(self.Owner:LookupAttachment("anim_attachment_rh"))
offset = hand.Ang:Right() * 1.5 + hand.Ang:Forward() * -6 + hand.Ang:Up() * 2.6
hand.Ang:RotateAroundAxis(hand.Ang:Right(), 0)
hand.Ang:RotateAroundAxis(hand.Ang:Forward(), 0)
hand.Ang:RotateAroundAxis(hand.Ang:Up(), -90)
self:SetRenderOrigin(hand.Pos + offset)
self:SetRenderAngles(hand.Ang)
self:DrawModel()
end
function SWEP:CHReloadAT()
self:SetNWBool("BlurIn",false)
self:SetNWInt("BlurAmount",0)
self:SetNWInt("IronBlurAmount",0)
end
function SWEP:AcrPunches()
if self.CustomPunch1 and CurTime() >= self.CustomPunch1 then
self.CustomPunch1 = nil
self.Owner:ViewPunch(Angle(1.5,0.8,0))
end
if self.CustomPunch2 and CurTime() >= self.CustomPunch2 then
self.CustomPunch2 = nil
self.Owner:ViewPunch(Angle(-2,-3,0))
end
if self.CustomPunch3 and CurTime() >= self.CustomPunch3 then
self.CustomPunch3 = nil
self.Owner:ViewPunch(Angle(1.3,-0.65,0))
end
if self.CustomPunch4 and CurTime() >= self.CustomPunch4 then
self.CustomPunch4 = nil
self.Owner:ViewPunch(Angle(-1.3,0.65,0))
end
end
function SWEP:MuzzleEffect()
self.Owner:GetViewModel():StopParticles()
ParticleEffectAttach( self.Primary.Muzzle, PATTACH_POINT_FOLLOW, self.Owner:GetViewModel(), self.Owner:GetViewModel():LookupAttac
Put [lua] at the start then[./lua] at the end (removing the.)
Sorry, you need to Log In to post a reply to this thread.