Unstick Command 1.0.0 (olds.ro)
===============================
Frees players who are stuck inside a wall or inside another player. The
player types /stuck in chat, stands still for 3 seconds and is moved to the
nearest free spot. Each player may do this twice per round. Admins can free
another player at once with amx_unstick.
Requirements
- ReHLDS, ReGameDLL_CS, Metamod-R, ReAPI
- AMX Mod X 1.10 or newer (written and tested on 1.10.0.5490)
Install
1. Compile scripting/olds_unstick.sma and copy olds_unstick.amxx to
addons/amxmodx/plugins/. The compiler needs ReAPI's include files
(reapi.inc and the reapi_*.inc files from the ReAPI release) next to the
stock AMX Mod X includes.
2. Copy data/lang/olds_unstick.txt to addons/amxmodx/data/lang/.
3. Copy configs/plugins/olds_unstick.cfg to addons/amxmodx/configs/plugins/
(if it is missing, the plugin writes it with the default values).
4. Add olds_unstick.amxx to addons/amxmodx/configs/plugins.ini.
Commands
say /stuck (also in team chat) Frees you if you are stuck.
amx_unstick <name|#userid> Admins with the kick flag (c, ADMIN_KICK): frees
another player at once, without the wait and
without using up that player's /stuck uses.
Each use is written to the AMX Mod X log.
How it works
- A player is stuck when their body (standing or crouched) overlaps the
map or another player where they stand. A player who is not stuck is
told so and is not moved.
- After /stuck the player must stand still for olds_ustk_delay seconds.
Moving more than a few units cancels the request; a player who got free
in the meantime is not moved and keeps the use.
- The free spot is searched in a spiral around the player: rings 8 units
apart up to olds_ustk_radius, 16 directions on each ring, first at the
same height, then one ring higher. A player stuck only inside another
player is never moved through a wall.
- With no free spot nearby and olds_ustk_spawn 1, the player goes to a free
spawn point of their own team. Otherwise they are told no spot was found.
- Every player gets their uses back at the start of each round.
Settings (addons/amxmodx/configs/plugins/olds_unstick.cfg)
olds_ustk_radius 48 farthest distance searched for a free spot (16 - 256 units)
olds_ustk_uses 2 /stuck moves per player per round (0 = no limit)
olds_ustk_delay 3 seconds the player must stand still first (0 - 30, 0 = at once)
olds_ustk_spawn 1 1 = with no free spot nearby, move the player to a team spawn
Tested on ReHLDS 3.15.0.896, ReGameDLL_CS 5.30.0.814, Metamod-R 1.3.0.149,
AMX Mod X 1.10.0-git5490, ReAPI 5.29.0.358, with bots on de_dust2: a player
put inside another player and freed 3 seconds after /stuck; "not stuck" when
free; the third /stuck in a round refused with 2 uses and allowed again next
round; a player deep in the ground moved to a team spawn, or told no spot was
found with olds_ustk_spawn 0; amx_unstick refused without the kick flag and
working with it and from the server console; the request cancelled when the
player moves, a second /stuck while waiting answered "already running", no
move for a player who got free while waiting; olds_ustk_delay 0 moving at
once.
Note: the game itself pushes a player out of another player when that player
jumps, ducks or shoots. /stuck is for the player who stands still and stays
stuck, and for players stuck in the map.
No sounds, models or sprites are added.
Credits and licence
Written from scratch by alexit (olds.ro workshop) for workshop card LIB-2007.
Licence: GNU GPL version 3 or later (GPL-3.0-or-later).