Added a CVAR for saving class selection after map changes.

This commit is contained in:
richard 2008-10-12 18:56:51 +02:00
parent f7c2a11576
commit 9d35648089
4 changed files with 20 additions and 6 deletions

View File

@ -1,3 +1,7 @@
2008.10.11 - 2.5.1.9 - Richard
* Added CVAR for saving class selection after map changes. Default: off.
If default classes are used, this one should be off.
2008.10.11 - 2.5.1.8 - Richard 2008.10.11 - 2.5.1.8 - Richard
* Added CVAR for setting default class. * Added CVAR for setting default class.

View File

@ -15,7 +15,7 @@
#undef REQUIRE_PLUGIN #undef REQUIRE_PLUGIN
#include <market> #include <market>
#define VERSION "2.5.1.8" #define VERSION "2.5.1.9"
#include "zr/zombiereloaded" #include "zr/zombiereloaded"
#include "zr/global" #include "zr/global"
@ -116,6 +116,16 @@ public OnMapStart()
LoadModelData(); LoadModelData();
LoadDownloadData(); LoadDownloadData();
/* Reset to default class if class selection saving is disabled. */
if (!GetConVarBool(gCvars[CVAR_CLASSES_SAVE]))
{
new i;
for (i = 1; i <= MAXPLAYERS; i++)
{
pClass[i] = GetDefaultClassIndex();
}
}
} }
public OnConfigsExecuted() public OnConfigsExecuted()

View File

@ -19,6 +19,7 @@ enum ZRSettings
Handle:CVAR_CLASSES_SPAWN, Handle:CVAR_CLASSES_SPAWN,
Handle:CVAR_CLASSES_RANDOM, Handle:CVAR_CLASSES_RANDOM,
Handle:CVAR_CLASSES_DEFAULT, Handle:CVAR_CLASSES_DEFAULT,
Handle:CVAR_CLASSES_SAVE,
Handle:CVAR_ZOMBIE_HEALTH, Handle:CVAR_ZOMBIE_HEALTH,
Handle:CVAR_ZOMBIE_SPEED, Handle:CVAR_ZOMBIE_SPEED,
Handle:CVAR_ZOMBIE_JUMP_DISTANCE, Handle:CVAR_ZOMBIE_JUMP_DISTANCE,
@ -88,6 +89,7 @@ CreateCvars()
gCvars[CVAR_CLASSES_SPAWN] = CreateConVar("zr_classes_spawn", "0", "Classmenu is re-displayed every spawn (0: Disable)"); gCvars[CVAR_CLASSES_SPAWN] = CreateConVar("zr_classes_spawn", "0", "Classmenu is re-displayed every spawn (0: Disable)");
gCvars[CVAR_CLASSES_RANDOM] = CreateConVar("zr_classes_random", "0", "A random class is assigned to each player every round (0: Disable)"); gCvars[CVAR_CLASSES_RANDOM] = CreateConVar("zr_classes_random", "0", "A random class is assigned to each player every round (0: Disable)");
gCvars[CVAR_CLASSES_DEFAULT] = CreateConVar("zr_classes_default", "classic", "Default class selected for all players. Usage zr_classes_default <class name>"); gCvars[CVAR_CLASSES_DEFAULT] = CreateConVar("zr_classes_default", "classic", "Default class selected for all players. Usage zr_classes_default <class name>");
gCvars[CVAR_CLASSES_SAVE] = CreateConVar("zr_classes_save", "0", "Remember class selection when changing maps.");
gCvars[CVAR_ZOMBIE_HEALTH] = CreateConVar("zr_zombie_health", "5000", "The default health of a zombie"); gCvars[CVAR_ZOMBIE_HEALTH] = CreateConVar("zr_zombie_health", "5000", "The default health of a zombie");
gCvars[CVAR_ZOMBIE_SPEED] = CreateConVar("zr_zombie_speed", "350", "How fast zombies travel (300: Default speed, 600: Double speed)"); gCvars[CVAR_ZOMBIE_SPEED] = CreateConVar("zr_zombie_speed", "350", "How fast zombies travel (300: Default speed, 600: Double speed)");
gCvars[CVAR_ZOMBIE_JUMP_DISTANCE] = CreateConVar("zr_zombie_jump_distance", "0.1", "How far the zombie jumps, (0: Regular jump distance)"); gCvars[CVAR_ZOMBIE_JUMP_DISTANCE] = CreateConVar("zr_zombie_jump_distance", "0.1", "How far the zombie jumps, (0: Regular jump distance)");

View File

@ -7,7 +7,7 @@ Section content is listed in order of importance. Some of these can be ideas too
the array pProtect isn't used at all, just set to off and on. the array pProtect isn't used at all, just set to off and on.
* DONE -- classes.inc:GetClassKnockback * DONE -- classes.inc:GetClassKnockback
change class knockback to be a miltiplier of the default knockback (like the change class knockback to be a multiplier of the default knockback (like the
old ZR), not absolute values: old ZR), not absolute values:
knockback = default * class knockback knockback = default * class knockback
@ -15,9 +15,7 @@ Section content is listed in order of importance. Some of these can be ideas too
---- NORMAL/GAMEPLAY ---- ---- NORMAL/GAMEPLAY ----
* Make it possible to disable certain classes on certain maps. * Make it possible to disable certain classes on certain maps.
Admin command: zr_class_enabled <class name> <0/1>
* Make a CVAR for setting class selection to be remembered on map change.
Set default to off, so default class will always be selected on each map.
* Make a more advanced teleporter: * Make a more advanced teleporter:
- Admin command: zr_teleport <player> - Admin command: zr_teleport <player>
@ -29,7 +27,7 @@ Section content is listed in order of importance. Some of these can be ideas too
(make a separate inc-file for the teleporter) (make a separate inc-file for the teleporter)
* Zombie dont have fall damage (damage by player 0 = server should always work) * 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 same maps by Make it a CVAR, so for example zombies can't kill themselfs on some maps by
going through lasers. going through lasers.
* zombie.inc:KnockBack / cvars.inc * zombie.inc:KnockBack / cvars.inc