๐ซ Dust2 Yard Hole Kill Plugin
๐ Description
A Counter-Strike 1.6 plugin that automatically kills players if they stay too long in a specific zone on the de_dust2 map (the yard hole). The plugin works only on de_dust2 and automatically disables itself on other maps.
โจ Features
๐ฏ Core Functionality:
- Automatic zone detection - Checks player positions every second
- Warning timer - Counts seconds while player is in the restricted zone
- HUD messages - Displays visual warnings on screen
- Automatic elimination - Kills the player after time expires
- Timer reset - Automatically resets timer when leaving the zone
๐ Zone Coverage:
Restricted zone coordinates (Yard Hole):
- X: 1296.0 to 1583.0
- Y: 48.0 to 753.0 (with -40.0 extension)
- Z: -144.0 to 36.0 (with -20.0 extension)
โ๏ธ Configuration
The plugin automatically creates a configuration file yard_hole.cfg in the configs/ folder.
๐ง CVARs (Console Variables):
CVAR Default Value Description
yard_hole_time10Seconds before killing the player
yard_hole_msg_inside"You are trapped in the yard hole! Leave within %d seconds or you will be eliminated!"Message when entering the zone
yard_hole_msg_death"You stayed too long! You are now dead."Message when killed
yard_hole_msg_exit"You have left the yard hole. Timer reset."Message when leaving the zone
๐ Configuration Example:
// Time before killing (in seconds)yard_hole_time "10"
// Messages (you can customize them)yard_hole_msg_inside "You are trapped in the yard hole! Leave within %d seconds or you will be eliminated!"yard_hole_msg_death "You stayed too long! You are now dead."yard_hole_msg_exit "You have left the yard hole. Timer reset."
๐ฆ Requirements
Dependencies:
amxmodx - Core AMX Mod X moduleamxmisc - Miscellaneous functionsengine - Engine functions for coordinate handling
System Requirements:
- AMX Mod X 1.8.2 or newer
- Counter-Strike 1.6 server
- Map: de_dust2
๐จ Installation
- Compilation:
amxxpc d2_yard_hole_kill.sma
- File Deployment:
- Copy
d2_yard_hole_kill.amxx to addons/amxmodx/plugins/ - Add to
addons/amxmodx/configs/plugins.ini:
d2_yard_hole_kill.amxx
- Restart:
- Restart the server or change map to
de_dust2
๐ฎ How It Works
- Map Check: On startup, the plugin verifies if the map is
de_dust2. If not, it automatically disables itself. - Player Monitoring: Every second, the plugin checks the position of all alive players.
- Zone Detection: If a player enters the restricted zone (yard hole):
- Starts counting seconds
- Displays red HUD message with remaining time
- Kills the player when time expires
- Zone Exit: If the player leaves the zone before time expires:
- Displays green HUD message
- Resets the timer
๐จ HUD Messages
๐ด Warning (Red):
- Position: Top center of the screen
- Color: Red (RGB: 255, 0, 0)
- Shows remaining seconds
๐ข Exit (Green):
- Position: Top center of the screen
- Color: Green (RGB: 0, 255, 0)
- Confirms zone exit
๐ ๏ธ Technical Details
Functions:
plugin_init() - Plugin initialization and map verificationcheck_player_positions() - Checks player positions every secondis_in_yard() - Determines if a player is in the restricted zone
Features:
- Uses
CreateHudSyncObj() for synchronized HUD messages - Automatically creates configuration file with
AutoExecConfig() - CVAR binding for dynamic configuration
- Every-second check via
set_task() with "b" flag (repeating task)
๐ค Author
illusion @ CraftVision
๐ Version
1.0
๐ License
This plugin is part of the ILLUSION PLUGINS collection.
๐ Known Issues
- Plugin only works on
de_dust2 - Coordinates are fixed and cannot be changed without recompilation