• Removing ThirdPerson View
    0 replies, posted
I've been making a thirdperson script based off of the Evolve Plugin (sh_thirdperson). I can get the player into thirdperson but I can't get out of it. If anyone knows how to do this I would appreciate it. Server: [lua]function _R.Player:SetThirdPerson( p, s ) if s ~= nil then umsg.Start( "third", p ) umsg.Bool( tostring( s ) ); umsg.End(); end; end; concommand.Add( "set_thirdperson", function( p, c, a ) p:SetThirdPerson( p, true ); end ); concommand.Add( "remove_thirdperson", function( p, c, a ) p:SetThirdPerson( p, false ); end );[/lua] Client: [lua]usermessage.Hook( "third", function( u ) LocalPlayer().ThirdPerson = u:ReadBool(); end ); hook.Add("CalcView", "ThirdPersonCalc", function( ply, pos, angles, fov ) if ply.ThirdPerson then return { origin = pos - ( angles:Forward() * 100 ), angles = angles, fov = fov } end; end ); hook.Add( "ShouldDrawLocalPlayer", "ThirdPersonShouldDraw", function( p ) if p.ThirdPerson then return true; end; end );[/lua]
Sorry, you need to Log In to post a reply to this thread.