Advanced Third Person Camera Plugin for GoldSrc and Counter-Strike 1.6
A modular AMX Mod X / AMXX third-person camera plugin with 3 dynamic camera modes, per-player camera state, real-time
TraceLinewall collision handling, direct console/chat commands, runtime CVAR control, automatic camera lifecycle management and optionalxai_main_menuintegration.
Repository: https://github.com/xansuz/GoldSrc-Advanced-Thirdperson
Developer: @xansuz
Current Plugin Version: 1.0
XAI Advanced Third Person Camera is a standalone and modular AMX Mod X / AMXX third-person camera plugin for GoldSrc, designed primarily for Counter-Strike 1.6 (CS 1.6) and compatible GoldSrc server environments.
The plugin replaces the player's normal view attachment with a controlled camera entity when a third-person mode is active.
It provides:
- 🎥 3 distinct camera perspectives
- 👤 independent camera state for every player
- 🧱 real-time
TraceLinecamera collision handling - 🔄 camera cleanup and recreation during player lifecycle events
- 🎮 console and chat controls
- ⚙️ dynamic CVAR configuration
- 🧩 optional XAI main-menu integration
- 🛡️ no forced client
config.cfgmodification - 📦 no external camera model package required
- 🧱 standalone operation when
xai_main_menuis unavailable
The goal is a clean, reusable and independently deployable third-person camera component rather than a feature that requires the entire XAI framework.
| Feature | Status |
|---|---|
| GoldSrc camera system | ✅ |
| Counter-Strike 1.6 focused | ✅ |
| AMX Mod X plugin | ✅ |
| Pawn source included | ✅ |
Precompiled .amxx included |
✅ |
| 3 camera perspectives | ✅ |
| First-person fallback | ✅ |
| Per-player camera state | ✅ |
| Real-time camera update | ✅ |
| TraceLine wall collision | ✅ |
| Runtime camera padding | ✅ |
| Camera cleanup on death | ✅ |
| Camera recreation after spawn | ✅ |
| Camera cleanup on disconnect | ✅ |
| Chat commands | ✅ |
| Console commands | ✅ |
| Direct mode selection | ✅ |
| Optional XAI menu integration | ✅ |
| Standalone mode | ✅ |
| Forced client config modification | ❌ |
| External camera asset requirement | ❌ |
The plugin internally supports four states:
MODE 0 = First Person / Camera OFF
MODE 1 = Close Shoulder
MODE 2 = Tactical
MODE 3 = Cinematic Front
The cycle command follows:
0 → 1 → 2 → 3 → 0
Normal GoldSrc / player view.
Camera: OFF
When Mode 0 is selected, the plugin removes the custom camera entity and restores the player's normal view.
A close third-person perspective designed for normal gameplay.
Default values:
Distance: 88.0
Height: 24.0
Conceptually:
CAMERA
\
\
PLAYER
↑
LOOK DIR
This is the closest of the two rear-facing camera modes.
A wider third-person perspective that places the camera farther from the player.
Default values:
Distance: 176.0
Height: 36.0
This provides a wider field of view around the player and is useful when a broader gameplay perspective is desired.
A front-facing cinematic camera configuration.
Default values:
Distance: 88.0
Height: 24.0
The camera direction is reversed by approximately:
180°
and the pitch is inverted so that the camera faces the character from the opposite side.
This mode is intended for a front-facing / cinematic third-person experience.
One of the most important parts of the plugin is its camera geometry handling.
The camera does not simply move to a fixed location behind the player and ignore the map.
Instead, each active third-person update calculates:
Player Eye Position
↓
Desired Camera Position
↓
TraceLine
↓
Collision?
↙ ↘
YES NO
↓ ↓
Trace End Desired
Position Position
↓
Apply Padding
↓
Resolved Camera Position
The trace is performed between the player's eye position and the desired camera location.
When an obstacle is detected, the camera is moved toward the trace hit point and a configurable safety padding is applied.
The implementation uses:
EngFunc_TraceLineand resolves the final camera position using the trace fraction and trace end position.
The wall protection is therefore TraceLine based.
This should not be confused with a full volumetric swept-hull camera collision system. The current implementation performs a line-based geometry check.
This distinction is documented intentionally so server administrators know exactly what the plugin does.
Camera state is stored individually for every player.
Each player maintains:
Third Person Mode
Camera Entity
independently.
For example:
Player 1 → Mode 1
Player 2 → Mode 0
Player 3 → Mode 3
Player 4 → Mode 2
Changing one player's camera does not change another player's camera state.
The plugin actively manages camera entities during player lifecycle events.
A new player starts with:
Mode = 0
Camera Entity = none
A short welcome/help message is then printed to the player's console/chat.
If a player already has a third-person mode selected:
Mode > 0
the plugin schedules a camera recreation after spawn.
This prevents the camera state from being permanently lost when the player respawns.
When the player dies:
Camera Entity → removed
The normal player view is restored.
When a player disconnects:
Camera Entity → removed
Camera State → reset
This prevents stale camera entities from remaining associated with a disconnected player.
xai_thirdperson
Every execution advances the camera state:
0 → 1 → 2 → 3 → 0
The plugin also supports:
xai tp
and:
xai thirdperson
These execute the same camera cycle functionality.
Use:
xai_tp_mode <0-3>
Examples:
xai_tp_mode 0
xai_tp_mode 1
xai_tp_mode 2
xai_tp_mode 3
Values outside the supported range are normalized to:
0
Therefore:
xai_tp_mode 4
does not create a fifth camera mode.
The plugin recognizes:
/tp
!tp
/thirdperson
Team chat also supports:
/tp
These commands cycle the camera mode.
The recommended client-side bind is:
bind F1 xai_thirdperson
This gives the player a convenient one-key camera switch.
The plugin does not force this bind.
The player chooses whether to add the bind to the client.
No automatic:
config.cfg
modification is performed.
The plugin exposes seven configurable CVARs.
| CVAR | Default | Runtime Range | Purpose |
|---|---|---|---|
xai_tp_close_distance |
88.0 |
40.0 - 320.0 |
Mode 1 camera distance |
xai_tp_close_height |
24.0 |
-24.0 - 96.0 |
Mode 1 camera height |
xai_tp_far_distance |
176.0 |
40.0 - 320.0 |
Mode 2 camera distance |
xai_tp_far_height |
36.0 |
-24.0 - 96.0 |
Mode 2 camera height |
xai_tp_rear_distance |
88.0 |
40.0 - 320.0 |
Mode 3 camera distance |
xai_tp_rear_height |
24.0 |
-24.0 - 96.0 |
Mode 3 camera height |
xai_tp_padding |
12.0 |
2.0 - 32.0 |
Wall collision padding |
Camera values are clamped during runtime.
Minimum = 40.0
Maximum = 320.0
Therefore:
distance < 40.0
becomes:
40.0
and:
distance > 320.0
becomes:
320.0
Minimum = -24.0
Maximum = 96.0
Minimum = 2.0
Maximum = 32.0
This prevents unreasonable CVAR values from being used directly in the camera collision correction.
Create or edit:
addons/XAI-EKLENTISI/ozellikler/thirdperson.cfg
Example:
// XAI Advanced Third Person Camera
// Plugin Version: v1.0
xai_tp_close_distance "88.0"
xai_tp_close_height "24.0"
xai_tp_far_distance "176.0"
xai_tp_far_height "36.0"
xai_tp_rear_distance "88.0"
xai_tp_rear_height "24.0"
xai_tp_padding "12.0"You can also configure the CVARs from:
server.cfg
During plugin initialization the following configuration path is executed:
addons/XAI-EKLENTISI/ozellikler/thirdperson.cfg
This allows the camera configuration to remain separate from the main server configuration when desired.
The plugin can integrate with:
xai_main_menu
When that library/plugin is detected, the third-person feature registers itself with the main XAI menu.
The registered menu item is:
Third Person Kamera [F1 / 3 Mod]
and uses:
xai_thirdperson
as its command.
The main menu integration is optional.
XAI Main Menu
↓
Third Person Kamera
↓
xai_thirdperson
↓
Camera Cycle
Player
↓
xai_thirdperson
↓
Camera Cycle
The third-person camera plugin continues to work independently.
For every active third-person player, the plugin creates an info_target entity.
The runtime entity uses:
classname = xai_tp_cam
and is configured as:
MOVETYPE_NONE
SOLID_NOT
owner = player
The camera entity is hidden using:
EF_NODRAW
and the player's view is attached to the entity with:
attach_view(player, camera)When third-person mode is active, the plugin updates the camera during:
client_PreThink
The camera calculation uses:
Player Origin
View Offset
View Angle
Forward Vector
Camera Distance
Camera Height
Collision Trace
Padding
The resulting position and angles are then applied to the camera entity.
The simplified runtime flow is:
client_PreThink
↓
Check player alive
↓
Check active camera mode
↓
Read player origin
↓
Read player view offset
↓
Calculate eye position
↓
Calculate direction vectors
↓
Select camera mode
↓
Read CVAR distance/height
↓
Clamp runtime values
↓
Calculate desired camera position
↓
TraceLine
↓
Resolve collision
↓
Move camera entity
↓
Update camera angles
↓
attach_view()
This plugin is designed to avoid forced client configuration changes.
It does not automatically write a player bind such as:
bind F1 xai_thirdperson
to the player's:
config.cfg
The F1 bind is only provided as a recommended manual configuration.
The camera system itself does not require:
custom camera model
custom camera sprite
custom camera sound
The camera is created dynamically using a GoldSrc entity at runtime.
The camera entity can inherit the player's current model internally, but the entity is rendered hidden using:
EF_NODRAW
so a separate camera asset package is not required.
The repository contains a precompiled:
XAI-GoldSrc-Advanced-Thirdperson-Plugin.amxx
Copy:
XAI-GoldSrc-Advanced-Thirdperson-Plugin.amxx
to:
addons/amxmodx/plugins/
Open:
addons/amxmodx/configs/plugins.ini
Add:
XAI-GoldSrc-Advanced-Thirdperson-Plugin.amxx
Optional configuration:
addons/XAI-EKLENTISI/ozellikler/thirdperson.cfg
Restart the server or change the map.
Test:
xai_thirdperson
or:
/tp
The repository also contains the Pawn source:
XAI-GoldSrc-Advanced-Thirdperson-Plugin.sma
The source currently includes:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#include <xs>The plugin therefore expects the corresponding AMX Mod X development environment and include files.
AMX Mod X
engine
fakemeta
xai_main_menu
xai_main_menu is required only for automatic main-menu registration.
The camera itself can operate standalone.
Current repository structure:
GoldSrc-Advanced-Thirdperson/
│
├── LICENSE
├── README.md
│
├── XAI-GoldSrc-Advanced-Thirdperson-Plugin.amxx
└── XAI-GoldSrc-Advanced-Thirdperson-Plugin.sma
After installation, test the following:
xai_thirdperson
Expected sequence:
0 → 1 → 2 → 3 → 0
xai_tp_mode 0
xai_tp_mode 1
xai_tp_mode 2
xai_tp_mode 3
/tp
!tp
/thirdperson
xai tp
xai thirdperson
bind F1 xai_thirdperson
Test the camera near:
walls
corners
narrow corridors
small rooms
map obstacles
Test:
connect
spawn
third-person activation
death
respawn
disconnect
Check:
addons/amxmodx/configs/plugins.ini
and verify:
XAI-GoldSrc-Advanced-Thirdperson-Plugin.amxx
is present.
Then restart/change the map.
Verify the plugin is loaded.
Then test the direct console command:
xai_thirdperson
If the console command works while chat does not, check the exact chat command syntax:
/tp
!tp
/thirdperson
This is expected behavior.
The plugin removes the camera entity when the player dies.
After respawn, the selected third-person mode is reapplied when appropriate.
Increase:
xai_tp_padding
Example:
xai_tp_padding "16.0"The runtime-supported padding range is:
2.0 - 32.0
Reduce:
xai_tp_close_distance
or:
xai_tp_far_distance
depending on the active mode.
Remember that runtime distance is bounded to:
40.0 - 320.0
The third-person plugin is designed to work without the main menu.
Check that:
xai_main_menu
is actually loaded.
If it is unavailable, use:
xai_thirdperson
directly.
Yes.
The main menu integration is optional.
No.
Use:
bind F1 xai_thirdperson
manually if desired.
No forced client configuration modification is part of the implementation.
No.
The camera is created dynamically.
Yes.
The plugin stores camera state per player.
Mode 0 represents the normal first-person state / custom camera disabled state.
Yes:
xai_tp_mode 0
xai_tp_mode 1
xai_tp_mode 2
xai_tp_mode 3
Yes.
The plugin reads its camera CVAR values during runtime.
Yes.
The current implementation uses a GoldSrc TraceLine call between the player eye position and the desired camera position.
This project is intentionally documented around the terminology commonly used when searching for GoldSrc and Counter-Strike 1.6 plugins.
Relevant project terms include:
GoldSrc
GoldSrc plugin
Counter-Strike 1.6
CS 1.6
CS16
Counter Strike 1.6 plugin
AMX Mod X
AMXX
AMXX plugin
AMX plugin
Pawn plugin
Pawn scripting
third person
thirdperson
third person camera
thirdperson camera
camera plugin
camera system
GoldSrc camera
CS 1.6 third person
CS16 third person
CS 1.6 camera plugin
AMXX third person
AMX Mod X third person
multiplayer third person camera
GoldSrc third person camera
These terms are used as descriptive project terminology rather than as unrelated keyword stuffing.
XAI Advanced Third Person Camera is intentionally kept as a focused plugin.
The plugin owns:
Camera State
Camera Entity
Camera Modes
Camera CVARs
Camera Commands
Camera Collision Resolution
Camera Lifecycle
Main Menu Registration
It does not require the entire XAI framework to function.
This makes it suitable for:
Standalone GoldSrc servers
CS 1.6 servers
XAI-based servers
Modular AMX Mod X installations
Custom gameplay frameworks
The plugin is designed so that the camera feature can be deployed independently.
Architecture:
┌──────────────────┐
│ XAI Main Menu │
│ (Optional) │
└────────┬─────────┘
│
│ register
▼
┌──────────────────────┐
│ XAI Third Person │
│ Camera Plugin │
└──────────┬───────────┘
│
┌───────────────┼────────────────┐
│ │ │
▼ ▼ ▼
Camera Modes CVAR System Commands
│ │ │
└───────────────┼────────────────┘
▼
Runtime Camera Entity
│
▼
GoldSrc View
Source:
XAI-GoldSrc-Advanced-Thirdperson-Plugin.sma
Compiled plugin:
XAI-GoldSrc-Advanced-Thirdperson-Plugin.amxx
Plugin Name : XAI Advanced 3-Mode Third Person
Version : v1.0
Author : @xansuz
Engine : GoldSrc
Language : Pawn
Framework : AMX Mod X / AMXX
Camera Modes: 0, 1, 2, 3
License : MIT
This project is released under the:
MIT License
Copyright:
Copyright (c) 2026 xansuz
See the complete license:
LICENSE
Developed by:
GitHub:
Project:
https://github.com/xansuz/GoldSrc-Advanced-Thirdperson
If this plugin is useful for your GoldSrc / CS 1.6 server:
⭐ Star the repository
🐛 Report reproducible bugs
💡 Suggest technically relevant improvements
🔧 Contribute improvements
📖 Improve documentation
| Resource | Link |
|---|---|
| GitHub Repository | https://github.com/xansuz/GoldSrc-Advanced-Thirdperson |
| Source Code | XAI-GoldSrc-Advanced-Thirdperson-Plugin.sma |
| Compiled Plugin | XAI-GoldSrc-Advanced-Thirdperson-Plugin.amxx |
| License | LICENSE |
| AMX Mod X | https://www.amxmodx.org/ |
| Developer | https://github.com/xansuz |
XAI Advanced Third Person Camera
Version v1.0
Current implementation includes:
✓ 3 third-person perspectives
✓ First-person fallback
✓ Per-player mode state
✓ Runtime camera entity
✓ TraceLine collision resolution
✓ Configurable camera distance
✓ Configurable camera height
✓ Configurable wall padding
✓ Chat commands
✓ Console commands
✓ Direct mode selection
✓ XAI command aliases
✓ Optional xai_main_menu registration
✓ Spawn recovery
✓ Death cleanup
✓ Disconnect cleanup
✓ Client-friendly operation
This repository focuses specifically on the:
GoldSrc / Counter-Strike 1.6 / AMX Mod X Third Person Camera
It is not intended to replace:
server administration systems
bot AI systems
gameplay frameworks
economy systems
player management systems
complete XAI server cores
Instead, it provides a focused and reusable camera component that can be integrated into a larger XAI or AMXX server architecture.
GoldSrc • CS 1.6 • AMX Mod X • AMXX • Pawn • Third Person • Camera
Developed by @xansuz