Put spawn protect attributes into cvars.
This commit is contained in:
parent
a89f98cc38
commit
e1b1a21873
@ -92,6 +92,8 @@ enum CvarsList
|
|||||||
Handle:CVAR_ANTISTICK_INTERVAL,
|
Handle:CVAR_ANTISTICK_INTERVAL,
|
||||||
Handle:CVAR_SPAWNPROTECT,
|
Handle:CVAR_SPAWNPROTECT,
|
||||||
Handle:CVAR_SPAWNPROTECT_TIME,
|
Handle:CVAR_SPAWNPROTECT_TIME,
|
||||||
|
Handle:CVAR_SPAWNPROTECT_SPEED,
|
||||||
|
Handle:CVAR_SPAWNPROTECT_ALPHA,
|
||||||
Handle:CVAR_RESPAWN,
|
Handle:CVAR_RESPAWN,
|
||||||
Handle:CVAR_RESPAWN_DELAY,
|
Handle:CVAR_RESPAWN_DELAY,
|
||||||
Handle:CVAR_RESPAWN_ZOMBIE,
|
Handle:CVAR_RESPAWN_ZOMBIE,
|
||||||
@ -410,6 +412,8 @@ CvarsCreate()
|
|||||||
|
|
||||||
g_hCvarsList[CVAR_SPAWNPROTECT] = CreateConVar("zr_spawnprotect", "1", "");
|
g_hCvarsList[CVAR_SPAWNPROTECT] = CreateConVar("zr_spawnprotect", "1", "");
|
||||||
g_hCvarsList[CVAR_SPAWNPROTECT_TIME] = CreateConVar("zr_spawnprotect_time", "10", "");
|
g_hCvarsList[CVAR_SPAWNPROTECT_TIME] = CreateConVar("zr_spawnprotect_time", "10", "");
|
||||||
|
g_hCvarsList[CVAR_SPAWNPROTECT_SPEED] = CreateConVar("zr_spawnprotect_speed", "600.0", "");
|
||||||
|
g_hCvarsList[CVAR_SPAWNPROTECT_ALPHA] = CreateConVar("zr_spawnprotect_speed", "0", "");
|
||||||
|
|
||||||
// ===========================
|
// ===========================
|
||||||
// Respawn (module)
|
// Respawn (module)
|
||||||
|
@ -78,10 +78,13 @@ SpawnProtectOnClientSpawn(client)
|
|||||||
// Set spawn protect flag on client.
|
// Set spawn protect flag on client.
|
||||||
bInfectImmune[client][INFECT_TYPE_NORMAL] = true;
|
bInfectImmune[client][INFECT_TYPE_NORMAL] = true;
|
||||||
|
|
||||||
// Set improved attributes
|
// Get spawn protect attribute cvars.
|
||||||
// (Move to cvar?)
|
new Float:speed = GetConVarFloat(g_hCvarsList[CVAR_SPAWNPROTECT_SPEED]);
|
||||||
ToolsSetClientAlpha(client, 0);
|
new alpha = GetConVarInt(g_hCvarsList[CVAR_SPAWNPROTECT_ALPHA]);
|
||||||
ToolsSetClientLMV(client, 600.0);
|
|
||||||
|
// Set spawn protect attributes.
|
||||||
|
ToolsSetClientLMV(client, speed);
|
||||||
|
ToolsSetClientAlpha(client, alpha);
|
||||||
|
|
||||||
// Set time left to zr_protect_time's value.
|
// Set time left to zr_protect_time's value.
|
||||||
new protect_time = GetConVarInt(g_hCvarsList[CVAR_SPAWNPROTECT_TIME]);
|
new protect_time = GetConVarInt(g_hCvarsList[CVAR_SPAWNPROTECT_TIME]);
|
||||||
|
Loading…
Reference in New Issue
Block a user