Rescue Surface 1.1.6

What it does
Moves players who are stuck under the map back to the surface. When a player connects, wakes up or
respawns, the plugin checks whether they are inside the terrain: more than 2 m below the terrain
height at their spot and not in a space the game itself allows below ground. If so, they are moved
straight up to 3 m above the ground. On connect the check runs
four times over the first 6 seconds.

Players can also type /rescueme. When they are stuck in the terrain it moves them to 3 m above the
ground at their spot, with a 30 second cooldown, and it is refused for 20 seconds after the player
takes damage. When they are not stuck it says so and does nothing. Staff can rescue any online or sleeping player by name or SteamID.

The check uses the game's own inside-terrain test (the one its anti-cheat uses), so players in
train tunnels, the missile silo, bunkers, caves, labs and other spaces built below the ground are
left where they are. Staff can still lift anyone with rescue.surface.

Install
Drop plugins/RescueSurface.cs into carbon/plugins (Carbon) or oxide/plugins (Oxide).

Commands
/rescueme - rescue yourself (the name is set by SelfCommandName). Needs rescuesurface.use.
/rescue.surface <name or SteamID> - rescue another player. Needs rescuesurface.admin or auth level 1
    or higher.
rescue.surface <name or SteamID> - console form of the same. Works from the server console and RCON;
    an in-game caller needs rescuesurface.admin or auth level 1 or higher.

Permissions
rescuesurface.use - the self-rescue command. Granted to the default group every time the plugin
    loads; revoke it from the group after load if you want it staff-granted only.
rescuesurface.admin - rescue other players.

Config highlights
Config file: carbon/configs/RescueSurface.json
AutoRescueOnConnect = true, AutoRescueOnSleepEnded = true, AutoRescueOnRespawn = true - the
    automatic checks.
StuckDepthThreshold = 2.0 - metres below the terrain height that count as stuck.
RescueHeightAboveTerrain = 3.0 - metres above the terrain the player is placed.
AllowSelfCommand = true - registers the self-rescue command.
SelfCommandName = "rescueme" - name of the self-rescue command, without the slash.
SelfCommandCooldownSeconds = 30 - seconds between a player's self rescues.
BlockSelfCommandIfRecentlyDamaged = true, RecentDamageWindowSeconds = 20 - refuse self rescue for
    this long after taking damage.

Tested
Tested alone on Carbon 2.0.259.0 with Rust build 25454815 on 2026-09-28; runs without the rest of the MiX Server Pack.

Feedback
Questions, bugs and ideas: MixMods Discord, discord.gg/MZCdmvFrQ, message B1.

Licence
Free to run and change on your own servers. See LICENCE.txt.
