Fixed ztick still working when disabled. Code cleanup: Removed old teleport functions and debug messages in zspawn.

This commit is contained in:
richard 2009-01-14 01:04:29 +01:00
parent 525d25efd4
commit c2760c9de0
3 changed files with 6 additions and 63 deletions

View File

@ -1,3 +1,7 @@
2009.01.13 - 2.5.1.20
* Fixed zstuck still working when disabled.
* Code cleanup: Removed old teleport functions and debug messages in zspawn.
2009.01.13 - 2.5.1.19 2009.01.13 - 2.5.1.19
* Added per-client teleport buffers instead of one common (still only for admins). * Added per-client teleport buffers instead of one common (still only for admins).
* Made zr_tele_reset_buffers CVAR for resetting custom saved locations on round start. Abuse protection. * Made zr_tele_reset_buffers CVAR for resetting custom saved locations on round start. Abuse protection.

View File

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

View File

@ -197,98 +197,37 @@ public Market_PostOnWeaponSelected(client, &bool:allowed)
ZSpawn(client) ZSpawn(client)
{ {
if (GetConVarBool(gCvars[CVAR_DEBUG])) ZR_DebugPrintToConsole(client, "ZSpawn: Spawn request:");
new bool:spawn = GetConVarBool(gCvars[CVAR_ZSPAWN]); new bool:spawn = GetConVarBool(gCvars[CVAR_ZSPAWN]);
if (!spawn) if (!spawn)
{ {
ZR_PrintToChat(client, "Feature is disabled"); ZR_PrintToChat(client, "Feature is disabled");
if (GetConVarBool(gCvars[CVAR_DEBUG])) ZR_DebugPrintToConsole(client, "ZSpawn: Not enabled.");
return; return;
} }
new team = GetClientTeam(client); new team = GetClientTeam(client);
if (team != CS_TEAM_T && team != CS_TEAM_CT) if (team != CS_TEAM_T && team != CS_TEAM_CT)
{ {
if (GetConVarBool(gCvars[CVAR_DEBUG])) ZR_DebugPrintToConsole(client, "ZSpawn: Player is not a T or CT.");
return; return;
} }
if (IsPlayerAlive(client)) if (IsPlayerAlive(client))
{ {
if (GetConVarBool(gCvars[CVAR_DEBUG])) ZR_DebugPrintToConsole(client, "ZSpawn: Player appears to be alive.");
return; return;
} }
if (IsPlayerInList(client)) if (IsPlayerInList(client))
{ {
if (GetConVarBool(gCvars[CVAR_DEBUG])) ZR_DebugPrintToConsole(client, "ZSpawn: Player is already in the list (= maybe spawned, or bug).");
return; return;
} }
if (GetConVarBool(gCvars[CVAR_DEBUG])) ZR_DebugPrintToConsole(client, "ZSpawn: Spawned player");
RespawnPlayer(client); RespawnPlayer(client);
AddPlayerToList(client); AddPlayerToList(client);
} }
/*
ZTele(client)
{
new bool:tele = GetConVarBool(gCvars[CVAR_ZTELE]);
if (!tele)
{
ZR_PrintToChat(client, "Feature is disabled");
return;
}
new bool:tele_humans = GetConVarBool(gCvars[CVAR_ZTELE_HUMANS]);
if (!IsPlayerZombie(client) && !tele_humans && zombieSpawned)
{
ZR_PrintToChat(client, "!ztele humans restricted");
return;
}
if (!IsPlayerAlive(client) || tHandles[client][TTELE] != INVALID_HANDLE)
{
return;
}
new count = teleCount[client];
new limit = GetConVarInt(gCvars[CVAR_ZTELE_LIMIT]);
if (limit > 0)
{
if (count < limit)
{
tHandles[client][TTELE] = CreateTimer(3.0, Teleport, client, TIMER_FLAG_NO_MAPCHANGE);
teleCount[client]++;
ZR_PrintToChat(client, "!ztele amount", limit - teleCount[client]);
}
else
{
ZR_PrintToChat(client, "!ztele limit reached");
}
}
else
{
tHandles[client][TTELE] = CreateTimer(3.0, Teleport, client, TIMER_FLAG_NO_MAPCHANGE);
ZR_PrintToChat(client, "!ztele amount unlimited");
}
}
public Action:Teleport(Handle:timer, any:index)
{
TeleportEntity(index, spawnLoc[index], NULL_VECTOR, NULL_VECTOR);
tHandles[index][TTELE] = INVALID_HANDLE;
}
*/
ZStuck(client) ZStuck(client)
{ {
new bool:stuck = GetConVarBool(gCvars[CVAR_ZTELE]); new bool:stuck = GetConVarBool(gCvars[CVAR_ZSTUCK]);
if (!stuck) if (!stuck)
{ {
ZR_PrintToChat(client, "Feature is disabled"); ZR_PrintToChat(client, "Feature is disabled");