Made zr_suicide_world_damage CVAR for respawning as zombie if a zombie was killed by the world.
This commit is contained in:
parent
ef8a7e04b7
commit
0efabe1146
|
@ -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
|
2008.12.26 - 2.5.1.17
|
||||||
* Finished teleporter admin commands; zr_teleport, zr_tele_saveloc, zr_tele_loc, zr_tele_abort.
|
* Finished teleporter admin commands; zr_teleport, zr_tele_saveloc, zr_tele_loc, zr_tele_abort.
|
||||||
* Teleport admin menu made, but not coded.
|
* Teleport admin menu made, but not coded.
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
#undef REQUIRE_PLUGIN
|
#undef REQUIRE_PLUGIN
|
||||||
#include <market>
|
#include <market>
|
||||||
|
|
||||||
#define VERSION "2.5.1.17"
|
#define VERSION "2.5.1.18"
|
||||||
|
|
||||||
#include "zr/zombiereloaded"
|
#include "zr/zombiereloaded"
|
||||||
#include "zr/global"
|
#include "zr/global"
|
||||||
|
|
|
@ -49,6 +49,7 @@ enum ZRSettings
|
||||||
Handle:CVAR_RESPAWN_DELAY,
|
Handle:CVAR_RESPAWN_DELAY,
|
||||||
Handle:CVAR_SUICIDE,
|
Handle:CVAR_SUICIDE,
|
||||||
Handle:CVAR_SUICIDE_ECHO,
|
Handle:CVAR_SUICIDE_ECHO,
|
||||||
|
Handle:CVAR_SUICIDE_WORLD_DAMAGE,
|
||||||
Handle:CVAR_SPAWN_MIN,
|
Handle:CVAR_SPAWN_MIN,
|
||||||
Handle:CVAR_SPAWN_MAX,
|
Handle:CVAR_SPAWN_MAX,
|
||||||
Handle:CVAR_PROTECT,
|
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_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] = 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_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_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_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)");
|
gCvars[CVAR_PROTECT] = CreateConVar("zr_protect", "10", "Players that join late will be protected for this long, in seconds (0: Disable)");
|
||||||
|
|
|
@ -436,20 +436,21 @@ public Action:PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
|
||||||
new bonus = GetClassKillBonus(pClass[index]);
|
new bonus = GetClassKillBonus(pClass[index]);
|
||||||
AddPlayerScore(attacker, bonus);
|
AddPlayerScore(attacker, bonus);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
new debug_val = GetConVarInt(gCvars[CVAR_DEBUG]);
|
if (!IsClientPlayer(attacker))
|
||||||
new String:debug_msg[64];
|
{
|
||||||
|
gKilledByWorld[index] = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gKilledByWorld[index] = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (new x = 0; x < MAXTIMERS; x++)
|
for (new x = 0; x < MAXTIMERS; x++)
|
||||||
{
|
{
|
||||||
if (tHandles[index][x] != INVALID_HANDLE)
|
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]);
|
KillTimer(tHandles[index][x]);
|
||||||
tHandles[index][x] = INVALID_HANDLE;
|
tHandles[index][x] = INVALID_HANDLE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -872,6 +872,7 @@ public Action:EndProtect(Handle:timer, any:index)
|
||||||
|
|
||||||
RespawnPlayer(client)
|
RespawnPlayer(client)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!IsClientInGame(client))
|
if (!IsClientInGame(client))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -890,6 +891,13 @@ RespawnPlayer(client)
|
||||||
if (StrEqual(team, "zombie", false))
|
if (StrEqual(team, "zombie", false))
|
||||||
{
|
{
|
||||||
Zombify(client, 0);
|
Zombify(client, 0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (GetConVarBool(gCvars[CVAR_SUICIDE_WORLD_DAMAGE]) && gKilledByWorld[client])
|
||||||
|
{
|
||||||
|
Zombify(client, 0);
|
||||||
|
gKilledByWorld[client] = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,6 +45,7 @@ new bool:gBlockMotherInfect[MAXPLAYERS+1];
|
||||||
new bool:bZVision[MAXPLAYERS+1];
|
new bool:bZVision[MAXPLAYERS+1];
|
||||||
new bool:dispHP[MAXPLAYERS+1];
|
new bool:dispHP[MAXPLAYERS+1];
|
||||||
new bool:pProtect[MAXPLAYERS+1];
|
new bool:pProtect[MAXPLAYERS+1];
|
||||||
|
new bool:gKilledByWorld[MAXPLAYERS+1] = {false, ...};
|
||||||
|
|
||||||
new pClass[MAXPLAYERS+1];
|
new pClass[MAXPLAYERS+1];
|
||||||
new pNextClass[MAXPLAYERS+1];
|
new pNextClass[MAXPLAYERS+1];
|
||||||
|
|
4
todo.txt
4
todo.txt
|
@ -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,
|
* Make a admin command to read and write settings to a spesific class,
|
||||||
using key/value. Integrate it with the zr_admin menu.
|
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).
|
* Knockback presets (integrated into zombie admin menu).
|
||||||
Temporary do many changes on the zombies (by executing configs). Useful
|
Temporary do many changes on the zombies (by executing configs). Useful
|
||||||
settings or fun settings. SourceMod already has a execute config menu, but it
|
settings or fun settings. SourceMod already has a execute config menu, but it
|
||||||
|
|
Loading…
Reference in New Issue
Block a user