I'm wanting to make a script to simulate the 3rd person in games like Ghost recon and i know i need calc view but am unsure on how to make it where the cross hairs still show where you will shoot.Also i am having trouble turning it on and off.
here's my code please help me!
[lua]
local on = true
function MyCalcView(ply, origin, angles, fov)
local Origin = origin;
local Angles = angles;
local Fov = fov;
local view = {}
if(on == true)then
view.origin = Origin+angles:Right()*+15+angles:Forward()*-35
view.angles = Angles
view.fov = Fov
else
view.origin = Origin
view.angles = Angles
view.fov = Fov
end
return view
end
hook.Add("CalcView", "MyCalcView", MyCalcView)
hook.Add("ShouldDrawLocalPlayer", "MyHax ShouldDrawLocalPlayer", function(ply)
return true
end)
function setOn()
local on = false
if(on == true)then
on = false
else
on = true
end
end
concommand.Add( "d_setOn", setOn )
[/lua]
This may sound stupid but how do i go about doing that?
To get on/off working remove local on = false on line 27.
Sorry, you need to Log In to post a reply to this thread.