mirror of
https://github.com/metrostroi-repo/MetrostroiAddon.git
synced 2026-05-02 00:42:29 +00:00
ClientsideModel FIX
This commit is contained in:
@@ -102,6 +102,7 @@ end
|
||||
function TOOL:UpdateGhost()
|
||||
local good,canDraw
|
||||
for i,e in ipairs(self.GhostEntities) do
|
||||
if not IsValid(e) then continue end
|
||||
local t = self.Model[i]
|
||||
local pos,ang
|
||||
if i==1 then
|
||||
@@ -146,19 +147,20 @@ function TOOL:Think()
|
||||
self.GhostEntities = {}
|
||||
if type(self.Model) == "string" then
|
||||
self.GhostEntities[1] = ClientsideModel(self.Model,RENDERGROUP_OPAQUE)
|
||||
self.GhostEntities[1]:SetModel(self.Model)
|
||||
if IsValid(self.GhostEntities[1]) then self.GhostEntities[1]:SetModel(self.Model) end
|
||||
else
|
||||
for i,t in pairs(self.Model) do
|
||||
if type(t) == "string" then
|
||||
self.GhostEntities[i] = ClientsideModel(t,RENDERGROUP_OPAQUE)
|
||||
self.GhostEntities[i]:SetModel(t)
|
||||
if IsValid(self.GhostEntities[i]) then self.GhostEntities[i]:SetModel(t) end
|
||||
else
|
||||
self.GhostEntities[i] = ClientsideModel(t[1],RENDERGROUP_OPAQUE)
|
||||
self.GhostEntities[i]:SetModel(t[1])
|
||||
if IsValid(self.GhostEntities[i]) then self.GhostEntities[i]:SetModel(t[1]) end
|
||||
end
|
||||
end
|
||||
end
|
||||
for i,e in pairs(self.GhostEntities) do
|
||||
if not IsValid(e) then continue end
|
||||
e:SetRenderMode(RENDERMODE_TRANSALPHA)
|
||||
e.GetBodyColor = function() return Vector(1,1,1) end
|
||||
e.GetDirtLevel = function() return 0.25 end
|
||||
|
||||
@@ -322,8 +322,8 @@ function SWEP:CreateModels( tab )
|
||||
string.find(v.model, ".mdl") and file.Exists (v.model, "GAME") ) then
|
||||
|
||||
v.modelEnt = ents.CreateClientProp("models/metrostroi/81-717/reverser.mdl")
|
||||
v.modelEnt:SetModel(v.model)
|
||||
if (IsValid(v.modelEnt)) then
|
||||
v.modelEnt:SetModel(v.model)
|
||||
v.modelEnt:SetPos(self:GetPos())
|
||||
v.modelEnt:SetAngles(self:GetAngles())
|
||||
v.modelEnt:SetParent(self)
|
||||
|
||||
@@ -340,8 +340,8 @@ function SWEP:CreateModels( tab )
|
||||
string.find(v.model, ".mdl") and file.Exists (v.model, "GAME") ) then
|
||||
|
||||
v.modelEnt = ents.CreateClientProp("models/metrostroi/81-717/reverser.mdl")
|
||||
v.modelEnt:SetModel(v.model)
|
||||
if (IsValid(v.modelEnt)) then
|
||||
v.modelEnt:SetModel(v.model)
|
||||
v.modelEnt:SetPos(self:GetPos())
|
||||
v.modelEnt:SetAngles(self:GetAngles())
|
||||
v.modelEnt:SetParent(self)
|
||||
|
||||
@@ -357,8 +357,8 @@ function SWEP:CreateModels( tab )
|
||||
string.find(v.model, ".mdl") and file.Exists (v.model, "GAME") ) then
|
||||
|
||||
v.modelEnt = ents.CreateClientProp("models/metrostroi/81-717/reverser.mdl")
|
||||
v.modelEnt:SetModel(v.model)
|
||||
if (IsValid(v.modelEnt)) then
|
||||
v.modelEnt:SetModel(v.model)
|
||||
v.modelEnt:SetPos(self:GetPos())
|
||||
v.modelEnt:SetAngles(self:GetAngles())
|
||||
v.modelEnt:SetParent(self)
|
||||
|
||||
Reference in New Issue
Block a user