Reorganized cvars.inc, organized all cvars into module groups (to be updated later), removed unused cvars, made classes and weapons core modules (event forwarding priority), updated spawn protect cvars, added cvars to disable weapons, restrict, and hitgroups

This commit is contained in:
Greyscale
2009-04-20 02:56:26 +02:00
parent 8ac1361a70
commit 41153af5f4
30 changed files with 533 additions and 297 deletions

View File

@ -50,7 +50,7 @@ AmbientSoundsClientInit(client)
bool:AmbientSoundsValidateConfig()
{
// If ambience is disabled, then stop.
new bool:ambience = GetConVarBool(gCvars[CVAR_AMBIENTSOUNDS]);
new bool:ambience = GetConVarBool(g_hCvarsList[CVAR_AMBIENTSOUNDS]);
if (!ambience)
{
return false;
@ -64,7 +64,7 @@ bool:AmbientSoundsValidateConfig()
// Get ambient sound file.
decl String:sound[SOUND_MAX_PATH];
GetConVarString(gCvars[CVAR_AMBIENTSOUNDS_FILE], sound, sizeof(sound));
GetConVarString(g_hCvarsList[CVAR_AMBIENTSOUNDS_FILE], sound, sizeof(sound));
Format(sound, sizeof(sound), "sound/%s", sound);
// If file doesn't exist, then log error and stop.
@ -76,7 +76,7 @@ bool:AmbientSoundsValidateConfig()
}
// If volume is muted or invalid, then log error and stop.
new Float:ambientvolume = GetConVarFloat(gCvars[CVAR_AMBIENTSOUNDS_VOLUME]);
new Float:ambientvolume = GetConVarFloat(g_hCvarsList[CVAR_AMBIENTSOUNDS_VOLUME]);
if (ambientvolume <= 0.0)
{
// Log invalid ambient sound volume error.
@ -85,7 +85,7 @@ bool:AmbientSoundsValidateConfig()
}
// If length is invalid, then log error and stop.
new Float:ambientlength = GetConVarFloat(gCvars[CVAR_AMBIENTSOUNDS_LENGTH]);
new Float:ambientlength = GetConVarFloat(g_hCvarsList[CVAR_AMBIENTSOUNDS_LENGTH]);
if (ambientlength <= 0.0)
{
// Log invalid ambient sound length error.
@ -138,10 +138,10 @@ AmbientSoundsOnClientSpawn(client)
// Get ambient sound file.
decl String:sound[SOUND_MAX_PATH];
GetConVarString(gCvars[CVAR_AMBIENTSOUNDS_FILE], sound, sizeof(sound));
GetConVarString(g_hCvarsList[CVAR_AMBIENTSOUNDS_FILE], sound, sizeof(sound));
// Get ambient sound volume.
new Float:ambientvolume = GetConVarFloat(gCvars[CVAR_AMBIENTSOUNDS_VOLUME]);
new Float:ambientvolume = GetConVarFloat(g_hCvarsList[CVAR_AMBIENTSOUNDS_VOLUME]);
// Emit ambient sound.
SEffectsEmitAmbientSound(sound, ambientvolume, client);
@ -177,7 +177,7 @@ AmbientSoundsRestart()
}
// Get ambient sound length.
new Float:ambientlength = GetConVarFloat(gCvars[CVAR_AMBIENTSOUNDS_LENGTH]);
new Float:ambientlength = GetConVarFloat(g_hCvarsList[CVAR_AMBIENTSOUNDS_LENGTH]);
// Start ambient sounds timer.
tAmbientSounds = CreateTimer(ambientlength, AmbientSoundsTimer, _, TIMER_FLAG_NO_MAPCHANGE);
@ -198,16 +198,16 @@ public Action:AmbientSoundsTimer(Handle:timer)
// Get ambient sound file.
decl String:sound[SOUND_MAX_PATH];
GetConVarString(gCvars[CVAR_AMBIENTSOUNDS_FILE], sound, sizeof(sound));
GetConVarString(g_hCvarsList[CVAR_AMBIENTSOUNDS_FILE], sound, sizeof(sound));
// Get ambient sound volume.
new Float:ambientvolume = GetConVarFloat(gCvars[CVAR_AMBIENTSOUNDS_VOLUME]);
new Float:ambientvolume = GetConVarFloat(g_hCvarsList[CVAR_AMBIENTSOUNDS_VOLUME]);
// Emit ambient sound.
SEffectsEmitAmbientSound(sound, ambientvolume);
// Get ambient sound length.
new Float:ambientlength = GetConVarFloat(gCvars[CVAR_AMBIENTSOUNDS_LENGTH]);
new Float:ambientlength = GetConVarFloat(g_hCvarsList[CVAR_AMBIENTSOUNDS_LENGTH]);
// Start new timer with sound length as delay.
tAmbientSounds = CreateTimer(ambientlength, AmbientSoundsTimer, _, TIMER_FLAG_NO_MAPCHANGE);

View File

@ -105,7 +105,7 @@ ZombieSoundsOnClientDeath(client)
}
// If death sound cvar is disabled, then stop.
new bool:death = GetConVarBool(gCvars[CVAR_SOUNDEFFECTS_DEATH]);
new bool:death = GetConVarBool(g_hCvarsList[CVAR_SOUNDEFFECTS_DEATH]);
if (!death)
{
return;
@ -132,7 +132,7 @@ ZombieSoundsOnClientHurt(client)
}
// Get groan factor, if 0, then stop.
new groan = GetConVarInt(gCvars[CVAR_SOUNDEFFECTS_GROAN]);
new groan = GetConVarInt(g_hCvarsList[CVAR_SOUNDEFFECTS_GROAN]);
if (!groan)
{
return;
@ -157,7 +157,7 @@ ZombieSoundsOnClientHurt(client)
ZombieSoundsOnClientInfected(client)
{
// If interval is set to 0, then stop.
new Float:interval = GetConVarFloat(gCvars[CVAR_SOUNDEFFECTS_MOAN]);
new Float:interval = GetConVarFloat(g_hCvarsList[CVAR_SOUNDEFFECTS_MOAN]);
if (!interval)
{
return;