Made zr_suicide_world_damage CVAR for respawning as zombie if a zombie was killed by the world.

This commit is contained in:
richard 2008-12-28 00:50:39 +01:00
parent ef8a7e04b7
commit 0efabe1146
7 changed files with 26 additions and 15 deletions

View File

@ -1,3 +1,6 @@
2008.12.27 - 2.5.1.18
* Made zr_suicide_world_damage CVAR for respawning as zombie if a zombie was killed by the world.
2008.12.26 - 2.5.1.17
* Finished teleporter admin commands; zr_teleport, zr_tele_saveloc, zr_tele_loc, zr_tele_abort.
* Teleport admin menu made, but not coded.

View File

@ -15,7 +15,7 @@
#undef REQUIRE_PLUGIN
#include <market>
#define VERSION "2.5.1.17"
#define VERSION "2.5.1.18"
#include "zr/zombiereloaded"
#include "zr/global"

View File

@ -49,6 +49,7 @@ enum ZRSettings
Handle:CVAR_RESPAWN_DELAY,
Handle:CVAR_SUICIDE,
Handle:CVAR_SUICIDE_ECHO,
Handle:CVAR_SUICIDE_WORLD_DAMAGE,
Handle:CVAR_SPAWN_MIN,
Handle:CVAR_SPAWN_MAX,
Handle:CVAR_PROTECT,
@ -126,6 +127,7 @@ CreateCvars()
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_SUICIDE_WORLD_DAMAGE] = CreateConVar("zr_suicide_world_damage", "1", "Respawn zombies as zombies if they was killed by the world, like elevators, doors and lasers.");
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)");

View File

@ -392,7 +392,7 @@ public Action:PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
new index = GetClientOfUserId(GetEventInt(event, "userid"));
new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
SetPlayerFOV(index, DEFAULT_FOV);
ExtinguishEntity(index);
@ -436,20 +436,21 @@ public Action:PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
new bonus = GetClassKillBonus(pClass[index]);
AddPlayerScore(attacker, bonus);
}
if (!IsClientPlayer(attacker))
{
gKilledByWorld[index] = true;
}
else
{
gKilledByWorld[index] = false;
}
}
new debug_val = GetConVarInt(gCvars[CVAR_DEBUG]);
new String:debug_msg[64];
for (new x = 0; x < MAXTIMERS; x++)
{
if (tHandles[index][x] != INVALID_HANDLE)
{
if (debug_val > 1)
{
Format(debug_msg, sizeof(debug_msg), "PlayerDeath - Killing timer %i with handle %x.", x, tHandles[index][x]);
ZR_DebugPrintToConsole(0, debug_msg);
}
KillTimer(tHandles[index][x]);
tHandles[index][x] = INVALID_HANDLE;
}

View File

@ -872,6 +872,7 @@ public Action:EndProtect(Handle:timer, any:index)
RespawnPlayer(client)
{
if (!IsClientInGame(client))
{
return;
@ -886,10 +887,17 @@ RespawnPlayer(client)
decl String:team[32];
GetConVarString(gCvars[CVAR_RESPAWN_TEAM], team, sizeof(team));
if (StrEqual(team, "zombie", false))
{
Zombify(client, 0);
return;
}
if (GetConVarBool(gCvars[CVAR_SUICIDE_WORLD_DAMAGE]) && gKilledByWorld[client])
{
Zombify(client, 0);
gKilledByWorld[client] = false;
}
}

View File

@ -45,6 +45,7 @@ new bool:gBlockMotherInfect[MAXPLAYERS+1];
new bool:bZVision[MAXPLAYERS+1];
new bool:dispHP[MAXPLAYERS+1];
new bool:pProtect[MAXPLAYERS+1];
new bool:gKilledByWorld[MAXPLAYERS+1] = {false, ...};
new pClass[MAXPLAYERS+1];
new pNextClass[MAXPLAYERS+1];

View File

@ -15,10 +15,6 @@ Section content is listed in order of importance. Some of these can be ideas too
* Make a admin command to read and write settings to a spesific class,
using key/value. Integrate it with the zr_admin menu.
* Zombie dont have fall damage (damage by player 0 = server should always work)
Make it a CVAR, so for example zombies can't kill themselfs on some maps by
going through lasers.
* Knockback presets (integrated into zombie admin menu).
Temporary do many changes on the zombies (by executing configs). Useful
settings or fun settings. SourceMod already has a execute config menu, but it