View Single Post
Author Message
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 01-03-2013 , 15:48   [TF2] Third Person / Clientprefs - (1.3.1) 4/25/2013
Reply With Quote #1

This is a really simple plugin that sets the forced taunt camera to allow players to go into third person. It saves their setting so that it will persist between connects/maps. It also attempts to address an issue where sometimes when you spawn, you will not be able to go into third person without going back into first person - by doing this automatically each time. The command handlers check if you are in first/third person, and omit repeated spam accordingly.


CVARs:
sm_tpcookie_version: version number, for tracking (don't change)
sm_tpcookie_enabled: (1) - Enable/Disable Plugin [0/1]

If you disable the plugin (or unload it), it should force everyone back into first person.

Commands:
sm_thirdperson or tp: Third Person
sm_firstperson or fp: First Person

Users should be familiar with these commands from other third person plugins.

Code:
2013-1-3 (v1.0.0)
* Initial Release

2013-1-3 (v1.1.0)
* Changed some MAXPLAYERS to MaxClients that were accidentally used in loops.
* Added IsPlayerAlive Checks before setting camera.

2013-1-8 (v1.2.0)
* Added CheckCommandAccess, use "sm_thirdperson" as an override flag, default is 0.
* Prevented dead/spectating players from getting feedback from commands.
* Use SM translations (lol)

2013 1-17 (v1.3.0)
* Changed how events are loaded/unloaded
* Removed superfluous sdkhooks include, =S

2013 4-25 (v1.3.1)
* Minor code cleanup
* Timers use userid instead of client

2013 9-19(v1.3.4)
* Fixed some rare client not in game errors
* Added auto third person removal/addition when enabled for zooming in with sniper rifles.

2013 9-21(v1.3.5)
* Added enabled check to condition added/removed forwards :3
Requirements:
Clientprefs

Installation:
- Put SMX in plugins directory
- Optional: add "sm_thirdperson" "SOMEFLAGS" to your overrides file to restrict everyone from using the thirdperson/firstperson commands

Plans:
- Add commands to force third/first on people for funs.
- Add natives for other plugins to send fp/tp commands depending on the client's preferences (like -> go to TP for 10 seconds and back to first, only if you prefer first).
- Figure out if there is some way to fix the crosshair from randomly appearing in the middle of the player's body =/
Attached Files
File Type: sp Get Plugin or Get Source (tpc-1-3-5.sp - 4190 views - 7.4 KB)
File Type: smx tpc-1-3-5.smx (6.3 KB, 2318 views)

Last edited by friagram; 10-08-2013 at 17:30.
friagram is offline