• Changing view to third person
    7 replies, posted
How would I go about, on the DEPLOYMENT function of a SWEP, change the players view to third person? Without using "self.Owner:conCommand("thirdperson")" because that requires sv_cheats to be set to 1.
[b][url=wiki.garrysmod.com/?title=Gamemode.CalcView]Gamemode.CalcView [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]
Can you please elaborate? I want to run it in a SWEP, maybe give me a short snippet?
The link he gave you actually gives you an example.
[QUOTE=Toastermach10;22952655]Can you please elaborate? I want to run it in a SWEP, maybe give me a short snippet?[/QUOTE] Explain what you dont understand and I happly will answer your questions
What I don't understand is how you run a gamemode function in the deploy function of a SWEP, I know it's possibe, and I have looked at the defintion of Gamemode.CalcView before. I mean what do I put in for gamemode?
[QUOTE=Toastermach10;22952881]What I don't understand is how you run a gamemode function in the deploy function of a SWEP, I know it's possibe, and I have looked at the defintion of Gamemode.CalcView before. I mean what do I put in for gamemode?[/QUOTE] What? You just paste the hook (example below) in one of the SWEP's client-side Lua files. [lua] local view = {} hook.Add( "CalcView", "MyCalcViewHook", function( ply, origin, angles, fov ) view.origin = origin view.angles = angles view.fov = fov return view end ) [/lua]
thanks
Sorry, you need to Log In to post a reply to this thread.