error fix? moved stuff to load first and be sure skin is number
This commit is contained in:
parent
bc92a02f2a
commit
a1b830c7f6
@ -496,6 +496,64 @@ local matshiny = Material("models/shiny")
|
||||
local hasbgs = Material("eps/hasbgs4.png", "mips smooth") -- or hasbgs3 idk which better
|
||||
|
||||
|
||||
function Menu.UpdateFromConvars()
|
||||
if ( IsValid( mdl.EntityHands ) ) then
|
||||
mdl.EntityHands:Remove()
|
||||
end
|
||||
if ( IsValid( mdl.EntityHandsAnim ) ) then
|
||||
mdl.EntityHandsAnim:Remove()
|
||||
end
|
||||
mdl.EntityHandsAnim = ClientsideModel( handsAnimModel, RENDERGROUP_OTHER )
|
||||
mdl.EntityHandsAnim:SetNoDraw( true )
|
||||
mdl.EntityHandsAnim:SetPos( Vector( 0, 0, 0 ) )
|
||||
|
||||
if true or ( Menu.IsHandsTabActive() ) then
|
||||
mdl:SetModel( handsAnimModel )
|
||||
local model = LocalPlayer():GetInfo( "cl_playerhands" )
|
||||
|
||||
if ( model == "" ) then
|
||||
model = LocalPlayer():GetInfo( "cl_playermodel" )
|
||||
end
|
||||
|
||||
local mdlhands = player_manager.TranslatePlayerHands( model )
|
||||
|
||||
util.PrecacheModel( mdlhands.model )
|
||||
|
||||
mdl.EntityHands = ClientsideModel( mdlhands.model, RENDERGROUP_OTHER )
|
||||
mdl.EntityHands:SetParent( mdl.EntityHandsAnim )
|
||||
mdl.EntityHands:SetNoDraw( true )
|
||||
|
||||
local dumbassproof = mdlhands.skin
|
||||
if !isnumber( dumbassproof ) then
|
||||
dumbassproof = 0
|
||||
end
|
||||
|
||||
mdl.EntityHands:SetSkin( dumbassproof )
|
||||
mdl.EntityHands:SetBodyGroups( mdlhands.body )
|
||||
mdl.EntityHands.GetPlayerColor = function() return Vector( GetConVar( "cl_playercolor" ):GetString() ) end
|
||||
|
||||
Menu.PlayHandsPreviewAnimation( mdl, model )
|
||||
--Menu.RebuildBodygroupTab()
|
||||
--return
|
||||
end
|
||||
|
||||
if true then
|
||||
local model = LocalPlayer():GetInfo( "cl_playermodel" )
|
||||
local modelname = player_manager.TranslatePlayerModel( model )
|
||||
util.PrecacheModel( modelname )
|
||||
mdl:SetModel( modelname )
|
||||
mdl.Entity.GetPlayerColor = function() return Vector( GetConVar( "cl_playercolor" ):GetString() ) end
|
||||
mdl.Entity:SetPos( Vector( -100, 0, -61 ) )
|
||||
|
||||
plycol:SetVector( Vector( GetConVar( "cl_playercolor" ):GetString() ) )
|
||||
wepcol:SetVector( Vector( GetConVar( "cl_weaponcolor" ):GetString() ) )
|
||||
|
||||
Menu.PlayPreviewAnimation( mdl, model )
|
||||
Menu.RebuildBodygroupTab()
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function Menu.Setup()
|
||||
|
||||
Frame = vgui.Create( "DFrame" )
|
||||
@ -867,7 +925,7 @@ function Menu.Setup()
|
||||
|
||||
CL_REALHANDS:AddEffects( EF_BONEMERGE )
|
||||
CL_REALHANDS:SetBodyGroups(result.body)
|
||||
CL_REALHANDS:SetSkin(result.skin)
|
||||
CL_REALHANDS:SetSkin(isnumber(result.skin) and result.skin or 0)
|
||||
|
||||
CL_REALHANDS:SetParent( CL_FISTS )
|
||||
|
||||
@ -1998,64 +2056,6 @@ function Menu.Setup()
|
||||
|
||||
local handsAnimModel = Model( "models/weapons/chand_checker.mdl" )
|
||||
|
||||
function Menu.UpdateFromConvars()
|
||||
if ( IsValid( mdl.EntityHands ) ) then
|
||||
mdl.EntityHands:Remove()
|
||||
end
|
||||
if ( IsValid( mdl.EntityHandsAnim ) ) then
|
||||
mdl.EntityHandsAnim:Remove()
|
||||
end
|
||||
mdl.EntityHandsAnim = ClientsideModel( handsAnimModel, RENDERGROUP_OTHER )
|
||||
mdl.EntityHandsAnim:SetNoDraw( true )
|
||||
mdl.EntityHandsAnim:SetPos( Vector( 0, 0, 0 ) )
|
||||
|
||||
if true or ( Menu.IsHandsTabActive() ) then
|
||||
mdl:SetModel( handsAnimModel )
|
||||
local model = LocalPlayer():GetInfo( "cl_playerhands" )
|
||||
|
||||
if ( model == "" ) then
|
||||
model = LocalPlayer():GetInfo( "cl_playermodel" )
|
||||
end
|
||||
|
||||
local mdlhands = player_manager.TranslatePlayerHands( model )
|
||||
|
||||
util.PrecacheModel( mdlhands.model )
|
||||
|
||||
mdl.EntityHands = ClientsideModel( mdlhands.model, RENDERGROUP_OTHER )
|
||||
mdl.EntityHands:SetParent( mdl.EntityHandsAnim )
|
||||
mdl.EntityHands:SetNoDraw( true )
|
||||
|
||||
local dumbassproof = mdlhands.skin
|
||||
if !isnumber( dumbassproof ) then
|
||||
dumbassproof = 0
|
||||
end
|
||||
|
||||
mdl.EntityHands:SetSkin( dumbassproof )
|
||||
mdl.EntityHands:SetBodyGroups( mdlhands.body )
|
||||
mdl.EntityHands.GetPlayerColor = function() return Vector( GetConVar( "cl_playercolor" ):GetString() ) end
|
||||
|
||||
Menu.PlayHandsPreviewAnimation( mdl, model )
|
||||
--Menu.RebuildBodygroupTab()
|
||||
--return
|
||||
end
|
||||
|
||||
if true then
|
||||
local model = LocalPlayer():GetInfo( "cl_playermodel" )
|
||||
local modelname = player_manager.TranslatePlayerModel( model )
|
||||
util.PrecacheModel( modelname )
|
||||
mdl:SetModel( modelname )
|
||||
mdl.Entity.GetPlayerColor = function() return Vector( GetConVar( "cl_playercolor" ):GetString() ) end
|
||||
mdl.Entity:SetPos( Vector( -100, 0, -61 ) )
|
||||
|
||||
plycol:SetVector( Vector( GetConVar( "cl_playercolor" ):GetString() ) )
|
||||
wepcol:SetVector( Vector( GetConVar( "cl_weaponcolor" ):GetString() ) )
|
||||
|
||||
Menu.PlayPreviewAnimation( mdl, model )
|
||||
Menu.RebuildBodygroupTab()
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function Menu.UpdateFromControls()
|
||||
|
||||
RunConsoleCommand( "cl_playercolor", tostring( plycol:GetVector() ) )
|
||||
|
Loading…
Reference in New Issue
Block a user