• Detect when derma pannel is open?
    0 replies, posted
I'm using this third person script I found on here and was wondering if there is any way to detect when the point shop window is in view? I want it to force the client to first person if the point shop window is in view so their hats don't bug out on the preview window in case they are in third person. Would using something like "gui.IsGameUIVisible( )" work for this? The thirdperson script: [code]if( CLIENT ) then function ThirdPersonUmsg( data ) if( LocalPlayer().ThirdPerson == nil ) then LocalPlayer().ThirdPerson = true; else LocalPlayer().ThirdPerson = !LocalPlayer().ThirdPerson; end; end; usermessage.Hook( "ThirdPerson", ThirdPersonUmsg ); function ThirdPerson( ply, pos, ang, fov ) if( LocalPlayer().ThirdPerson ) then local view = {}; local dist = 100; local trace = {}; trace.start = pos; trace.endpos = pos - ( ang:Forward() * dist ); trace.filter = LocalPlayer(); local trace = util.TraceLine( trace ); if( trace.HitPos:Distance( pos ) < dist - 10 ) then dist = trace.HitPos:Distance( pos ) - 10; end; view.origin = pos - ( ang:Forward() * dist ); view.angles = ang; view.fov = fov; return view; end; end; hook.Add( "CalcView", "ThirdPerson", ThirdPerson ); function ThirdPersonSDLP() if( LocalPlayer().ThirdPerson ) then return true; end; end; hook.Add( "ShouldDrawLocalPlayer", "ThirdPersonSDLP", ThirdPersonSDLP ); else function ToggleThirdPerson( ply ) umsg.Start( "ThirdPerson", ply ); umsg.End(); end; hook.Add( "ShowTeam", "ToggleThirdPerson", ToggleThirdPerson ); end;[/code] anyone have any ideas?
Sorry, you need to Log In to post a reply to this thread.