A SourceMod plugin for Team Fortress 2 that allows players to customize their Field of View (FOV) and toggle between first-person and third-person camera views with persistent settings.
FOV-TP is a SourceMod plugin designed to enhance player experience in Team Fortress 2 by providing customizable camera controls. Players can set their preferred FOV within a safe range and switch between first-person and third-person perspectives, with all preferences saved using SourceMod's cookie system for persistence across sessions.
The plugin addresses the common player request for camera customization in TF2 servers, particularly useful for community servers that want to offer enhanced player agency. It uses SourceMod's client preferences (cookies) to store settings per-player and automatically reapplies them on spawn and class change.
- FOV Management: Allows players to set custom Field of View values between 20 and 200, with intelligent clamping and validation
- Camera Perspective: Enables toggling between first-person and third-person camera views using forced taunt cam mechanics
- Persistence: Saves player preferences using SourceMod cookies and automatically restores them across sessions and respawns
- Event Handling: Monitors player spawn and class change events to reapply saved settings automatically
- Custom FOV Settings: Players can set FOV values between 20-200 using
sm_fovorfovcommands - FOV Reset: Reset FOV to client's default settings by using the command without arguments
- Third-Person Toggle: Use
sm_tpto enable third-person camera view - First-Person Toggle: Use
sm_fpto return to first-person view - Persistent Preferences: All settings are saved per-player using SourceMod's cookie system
- Automatic Reapplication: Settings are restored on player spawn and class changes
- Safe Clamping: FOV values are automatically clamped to safe ranges to prevent exploits
- Console Protection: Commands blocked from server console, player-only execution
- SourceMod 1.10+ installed on your Team Fortress 2 server
- Team Fortress 2 dedicated server
- ClientPrefs extension enabled in SourceMod
- Download the compiled plugin or compile
FOTP.spusing the SourceMod compiler - Copy
FOTP.smxto your server'saddons/sourcemod/plugins/directory - Restart the server or use
sm plugins load FOTPto load the plugin - The plugin will automatically create necessary cookies and register commands
The plugin uses SourceMod's cookie system for storing player preferences. No additional configuration files are needed.
| Command | Description | Usage |
|---|---|---|
sm_fov [value] |
Set FOV or reset to default | sm_fov 90 or sm_fov to reset |
fov [value] |
Alias for sm_fov | fov 120 |
sm_tp |
Enable third-person view | sm_tp |
sm_fp |
Enable first-person view | sm_fp |
| Constant | Value | Description |
|---|---|---|
MIN_FOV |
20 | Minimum allowed FOV value |
MAX_FOV |
200 | Maximum allowed FOV value |
DEFAULT_FOV |
90 | Default FOV when reset |
FOV-TP/
├── scripting/
│ └── FOTP.sp # Main plugin source code
├── LICENSE # MIT License
└── README.md # This file
To compile the plugin:
spcomp FOTP.spThe compiled .smx file will be placed in the compiled/ directory.
See LICENSE file for details.