• CalcView without view override?
    2 replies, posted
I just wanted to know is there any possible way to be using calcview and returning a view override, but to also be using the GetViewModelPosition hook on a SWEP to modify it's position and angles in the first person view. Is there any way to make them work together?
[QUOTE=Ownage96;39115913]I just wanted to know is there any possible way to be using calcview and returning a view override, but to also be using the GetViewModelPosition hook on a SWEP to modify it's position and angles in the first person view. Is there any way to make them work together?[/QUOTE] [LUA]hook.Add("CalcView","cv",function(pl,pos,ang,fov,zNear,zFar) local wep = pl:GetActiveWeapon() if(IsValid(wep) && wep.GetViewModelPosition) then pos,ang = wep:GetViewModelPosition(pos *1,ang *1) end return { origin = pos, angles = ang, fov = fov, znear = zNear, zfar = zFar, drawviewer = false } end)[/lua]
[QUOTE=Silverlan;39115962][LUA]hook.Add("CalcView","cv",function(pl,pos,ang,fov,zNear,zFar) local wep = pl:GetActiveWeapon() if(IsValid(wep) && wep.GetViewModelPosition) then pos,ang = wep:GetViewModelPosition(pos *1,ang *1) end return { origin = pos, angles = ang, fov = fov, znear = zNear, zfar = zFar, drawviewer = false } end)[/lua][/QUOTE] Awesome, thanks. edit: Just tried it and it doesn't quite work how I intended, it still turns to the angle and everything however, my entire view shifts to those angles and not just my weapon. edit again: Oh never mind I was doing it wrong, Thanks
Sorry, you need to Log In to post a reply to this thread.