diff --git a/config/docs.cfg b/config/docs.cfg
index 4b3fffde..771df69d 100644
--- a/config/docs.cfg
+++ b/config/docs.cfg
@@ -178,6 +178,8 @@ docargument [L] [the list of CVARs] [] [0];
docargument [A] [the alias to store them in] [] [0];
docexample [storesets "sensitivity hudgun fov" tmp] [Example result: stores "3.000 1 120" into alias "tmp".];
docremark [Some idents cannot be stored via this command "(e.g. curname)", if an argument is given that cannot be used, the command will throw an error to notify you.];
+docident [onSuicide] [If this alias exists, it will be automatically executed whenever you suicide.];
+docident [onLastMin] [If this alias exists, it will be automatically executed on the last minute remaining mark.];
docsection [General]
docident [addserver] [Adds a server to the list of server to query in the server list menu.];
docargument [S] [the address of the server (hostname or IP)] [] [0];
diff --git a/docs/reference.xml b/docs/reference.xml
index 211fcaca..68901e27 100644
--- a/docs/reference.xml
+++ b/docs/reference.xml
@@ -2584,6 +2584,14 @@ Output:
+
+
+ If this alias exists, it will be automatically executed whenever you suicide.
+
+
+
+ If this alias exists, it will be automatically executed on the last minute remaining mark.
+
diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp
index ec8f5478..ff24c3b0 100644
--- a/source/src/clientgame.cpp
+++ b/source/src/clientgame.cpp
@@ -766,7 +766,11 @@ void dokill(playerent *pl, playerent *act, bool gib, int gun)
void (*outf)(const char *s, ...) = (pl == player1 || act == player1) ? hudoutf : conoutf;
if(pl==act)
+ {
outf("\f2%s suicided%s", pname, pl==player1 ? "!" : "");
+ if(pl==player1)
+ if(identexists("onSuicide")) execute("onSuicide");
+ }
else if(isteam(pl->team, act->team))
{
if(pl==player1) outf("\f2you were %s by teammate %s", death, aname);
@@ -882,6 +886,7 @@ void timeupdate(int milliscur, int millismax)
{
audiomgr.musicsuggest(M_LASTMINUTE1 + rnd(2), 70*1000, true);
hudoutf("1 minute left!");
+ if(identexists("onLastMin")) execute("onLastMin");
}
else if(clockdisplay==0) conoutf(_("time remaining: %d minutes"), minutesremaining);
}