[QUOTE=|FlapJack|;24622809]CalcView[/QUOTE]
Yeah, I did look into this but I couldn't figure out how to use it.
Could you please give me an example?
[b][url=wiki.garrysmod.com/?title=Gamemode.CalcView]Gamemode.CalcView [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]
The example given on the page is a good one.
Okay guys, I did look into the function for the 'CLASS' feature and I applied some code. But now it just remains in the same position as it did before instead of going to my position?
Come someone help me on this? I will post the function.
[lua]
function CLASS:CalcView( pl, pos, ang, fov )
local view={}
view.origin=pl:GetShootPos()+Vector(0,-300,64)
view.angles=Angle(0,-90,0)
view.fov=fov
return view
end
[/lua]
-snip-
[b]Update:[/b]
I've changed my CalcView to cl_init.lua.
[lua]
include( 'shared.lua' )
function GM:PositionScoreboard( ScoreBoard )
ScoreBoard:SetSize( 700, ScrH() - 100 )
ScoreBoard:SetPos( (ScrW() - ScoreBoard:GetWide()) / 2, 50 )
end
function Calcy(ply,origin,angles,fov)
local view={}
view.origin=origin+Vector(0,-300,64)
view.angles=Angle(0,0,0)
view.fov=fov
return view
end
hook.Add("CalcView", "MyCalcView", Calcy)
[/lua]
Note, I still have the same problem.
Sorry, you need to Log In to post a reply to this thread.