Report abuse

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
function SWEP:MakeOtherModel()
if (CLIENT) then
local vm = self.Owner:GetViewModel()
self.Owner.Decor1 = ClientsideModel("models/weapons/v_pistol.mdl", RENDER_GROUP_VIEW_MODEL_OPAQUE)
self.Owner.Decor1:SetPos(vm:GetPos() + vm:GetRight()*0)
self.Owner.Decor1:SetAngles(vm:GetAngles())
self.Owner.Decor1:SetParent(vm)
self.Owner.Decor1:SetModelScale(Vector(1, 1, 1))
self.Owner.Decor1:SetNoDraw(true)
end
end

function SWEP:ViewModelDrawn()
if (CLIENT) then
if not self.Owner.Decor1 then self:MakeOtherModel() end
if self.Owner.Decor1 then self.Owner.Decor1:DrawModel() end
if LocalPlayer():GetActiveWeapon():GetNWBool("OtherModRePos") then
self.Owner.Decor1:Remove()
self:MakeOtherModel()
end
self.Owner.Decor1:FrameAdvance( RealFrameTime( ) )
if self.Weapon:GetNWBool("SecDraw") then
self.Owner.Decor1:SetSequence(self.Owner.Decor1:LookupSequence("draw"))
self.Owner.Decor1:SetCycle(0)
end
if self.Weapon:GetNWBool("SecIdle") then
self.Owner.Decor1:SetSequence(self.Owner.Decor1:LookupSequence("idle01"))
self.Owner.Decor1:SetCycle(0)
end
if self.Weapon:GetNWBool("SecIdleEmpty") then
self.Owner.Decor1:SetSequence(self.Owner.Decor1:LookupSequence("idle01empty"))
self.Owner.Decor1:SetCycle(0)
end
if self.Weapon:GetNWBool("SecFire") then
self.Owner.Decor1:SetCycle(0)
self.Owner.Decor1:SetSequence(self.Owner.Decor1:LookupSequence("fire"..math.random(1,3)..""))
self.Owner.Decor1:SetCycle(0)
end
if self.Weapon:GetNWBool("SecReload") then
self.Owner.Decor1:SetSequence(self.Owner.Decor1:LookupSequence("reload"))
self.Owner.Decor1:SetCycle(0)
end
end
end