Put spawn protect attributes into cvars.

This commit is contained in:
Greyscale 2009-05-06 07:13:05 +02:00
parent a89f98cc38
commit e1b1a21873
2 changed files with 11 additions and 4 deletions

View File

@ -92,6 +92,8 @@ enum CvarsList
Handle:CVAR_ANTISTICK_INTERVAL,
Handle:CVAR_SPAWNPROTECT,
Handle:CVAR_SPAWNPROTECT_TIME,
Handle:CVAR_SPAWNPROTECT_SPEED,
Handle:CVAR_SPAWNPROTECT_ALPHA,
Handle:CVAR_RESPAWN,
Handle:CVAR_RESPAWN_DELAY,
Handle:CVAR_RESPAWN_ZOMBIE,
@ -410,6 +412,8 @@ CvarsCreate()
g_hCvarsList[CVAR_SPAWNPROTECT] = CreateConVar("zr_spawnprotect", "1", "");
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)

View File

@ -78,10 +78,13 @@ SpawnProtectOnClientSpawn(client)
// Set spawn protect flag on client.
bInfectImmune[client][INFECT_TYPE_NORMAL] = true;
// Set improved attributes
// (Move to cvar?)
ToolsSetClientAlpha(client, 0);
ToolsSetClientLMV(client, 600.0);
// Get spawn protect attribute cvars.
new Float:speed = GetConVarFloat(g_hCvarsList[CVAR_SPAWNPROTECT_SPEED]);
new alpha = GetConVarInt(g_hCvarsList[CVAR_SPAWNPROTECT_ALPHA]);
// Set spawn protect attributes.
ToolsSetClientLMV(client, speed);
ToolsSetClientAlpha(client, alpha);
// Set time left to zr_protect_time's value.
new protect_time = GetConVarInt(g_hCvarsList[CVAR_SPAWNPROTECT_TIME]);