diff --git a/changelog.txt b/changelog.txt index 2ee89ce..2045168 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,7 @@ +2008.11.17 - 2.5.1.13 - Richard + * Made a switch for printing suicide attempts to admin chat. + * Added suicide response to client chat too, not just the console. + 2008.11.16 - 2.5.1.12 - Richard * Applied game rules not available fix from Grey Echo. diff --git a/src/zombiereloaded.sp b/src/zombiereloaded.sp index ae81bd4..c7e41ed 100644 --- a/src/zombiereloaded.sp +++ b/src/zombiereloaded.sp @@ -15,7 +15,7 @@ #undef REQUIRE_PLUGIN #include -#define VERSION "2.5.1.12" +#define VERSION "2.5.1.13" #include "zr/zombiereloaded" #include "zr/global" diff --git a/src/zr/cvars.inc b/src/zr/cvars.inc index b8d4d38..d4dac7b 100644 --- a/src/zr/cvars.inc +++ b/src/zr/cvars.inc @@ -48,6 +48,7 @@ enum ZRSettings Handle:CVAR_RESPAWN_TEAM, Handle:CVAR_RESPAWN_DELAY, Handle:CVAR_SUICIDE, + Handle:CVAR_SUICIDE_ECHO, Handle:CVAR_SPAWN_MIN, Handle:CVAR_SPAWN_MAX, Handle:CVAR_PROTECT, @@ -119,6 +120,7 @@ CreateCvars() gCvars[CVAR_RESPAWN_TEAM] = CreateConVar("zr_respawn_team", "zombie", "Which team to respawn player as (Choices: zombie, human)"); gCvars[CVAR_RESPAWN_DELAY] = CreateConVar("zr_respawn_delay", "1", "How long to wait after death to respawn, in seconds"); gCvars[CVAR_SUICIDE] = CreateConVar("zr_suicide", "1", "Stops players from suiciding"); + gCvars[CVAR_SUICIDE_ECHO] = CreateConVar("zr_suicide_echo", "0", "Log suicide attempts to admin chat."); gCvars[CVAR_SPAWN_MIN] = CreateConVar("zr_spawn_min", "30", "Minimum time a player is picked to be zombie after the round starts, in seconds"); gCvars[CVAR_SPAWN_MAX] = CreateConVar("zr_spawn_max", "50", "Maximum time a player is picked to be zombie after the round starts, in seconds"); gCvars[CVAR_PROTECT] = CreateConVar("zr_protect", "10", "Players that join late will be protected for this long, in seconds (0: Disable)"); diff --git a/src/zr/damagecontrol.inc b/src/zr/damagecontrol.inc index 1f14b0d..7543855 100644 --- a/src/zr/damagecontrol.inc +++ b/src/zr/damagecontrol.inc @@ -176,6 +176,17 @@ public Action:Attempt_Suicide(client, argc) } ZR_ReplyToCommand(client, "Suicide text"); - + ZR_PrintToChat(client, "Suicide text"); + + decl String:clientname[64]; + decl String:buffer[192]; + + if (GetConVarBool(gCvars[CVAR_SUICIDE_ECHO])) + { + GetClientName(client, clientname, sizeof(clientname)); + Format(buffer, sizeof(buffer), "Player '%s' attempted suicide.", clientname); + ZR_PrintToAdminChat(buffer); + } + return Plugin_Handled; } \ No newline at end of file diff --git a/src/zr/translation.inc b/src/zr/translation.inc index a808552..1738bd8 100644 --- a/src/zr/translation.inc +++ b/src/zr/translation.inc @@ -115,4 +115,17 @@ stock ZR_ReplyToCommand(client, any:...) FormatTextString(phrase, sizeof(phrase)); ReplyToCommand(client, phrase); +} + +stock ZR_PrintToAdminChat(String:message[]) +{ + decl String:buffer[192]; + Format(buffer, sizeof(buffer), "[ZR] %s", message); + for (new client = 1; client < maxclients; client++) + { + if (IsClientConnected(client) && IsClientInGame(client) && GetUserAdmin(client) != INVALID_ADMIN_ID) + { + PrintToChat(client, buffer); + } + } } \ No newline at end of file