Skip to content

Player classes

The class system makes it possible to have different zombies and humans with customized skills. It cannot be turned off, but class selection menus can be disabled. If there is only one class in each team, the class selections menus are automatically disabled.

The class configurations are stored in Valve's key/value format, and the file that's loaded should be specified in the "zr_config_path_playerclasses" console variable. It's possible to change this variable with per-map configuration files to have different sets of classes on one or more maps.

Default path is:

configs/zr/playerclasses.txt

Note: The path is relative to the "sourcemod" folder.

The file contains a short description of all attributes. Details are explained below.

Class Types

There are three class types; zombies, humans and admin-mode. Default classes are selected on the player depending on console variables and the class file.

Admin-mode classes are currently incomplete and will be validated, but ignored in the game. This is a special mode in the game, but not the same as admin-only classes. To get admin-only classes set the admin-only flag in the flags attribute.

Class Attributes

The list below explains all available class attributes in detail:

Class Attributes
Attribute: Value type: Limits/Requirements:
enabled text "yes" or "no"

Enables or disables the class. Disabled classes won't show up in the class selection menus. Also, if some attributes failed to validate the class will be disabled.

team number 0 - 2

Specifies the class type (team ID). Class types are filtered in the class selection menus, so only zombies can use zombie class types, and only humans can use human class types. These are the allowed team IDs:

0Zombie classes
1Human classes
2Admin-mode classes

The admin-mode class type sets the player in spectacting like mode, but allow admins to walk around. They can't take or give damage, and they won't affect the game rules in any way. Admin-mode is incomplete and classes of this type is ignored in the game.

See the flags attribute for admin-only classes.

team_default text "yes" or "no"

Marks the class as the default class for its specified team. This class will be automatically selected on new players when they join the server, depending on what's specified as default in the main configuration file (zr_classes_default_*). If multiple classes in the same team is marked as default the first class marked as default will be used.

flags number 0 - 3

Special class flags that are stored in a bit field (explained in Log Flags (3.3.1)). Available flags:

1 Admins only
Marks the class to be used by admins only. Classes with this option on will not be visible for regular players in the class menu.
2 Mother zombie.
Marks the class as a mother zombie class. These classes will be used on mother zombies. Note that zr_classes_default_mother_zombie setting must be set to motherzombies for this flag to be effective.

These flags can be used in a combination (1 + 2), so it could be a mother zombie class for admins only.

group text Name of a valid SourceMod group

Rescrict class to members of this SourceMod group. Useful for making VIP-only classes. Leave blank to allow everyone to use this class.

name text Unique, not empty, max 64 charact.

A unique name for the class that is displayed in the class selection menus. Cannot be empty. If multiple classes have the same name, the first one found is used.

This name is also refered to by cvars that set default classes.

description text Max 256 characters, not empty

The description of the class, used in class selection menus. Cannot be empty.

model_path text Max 256 characters, not empty

Model file path to use on the player, relative to the "cstrike" folder. There are a few presets supported by this attribute:

default Use default CS models. The one players select when selecting team.
random Selects a random public or admin model for the current team. Admin models are only applied to admins.
random_public Selects a random public model for the current team.
random_admin Selects a random admin model for the current team. Model permissions will be ignored.
random_hidden Selects a random hidden model for the current team.
random_mother_zombie Zombies only. Selects a random mother zombie model.
no_change Don't change model. Use this setting to keep default Counter-Strike: Source model, or to fix a compatibility issue with other plugins that change model on players.

Warning: If specifying a model path here, remember to add a matching model entry in the model config file (models.txt), or you will get an error about model was not precached. In worst case the server will crash.

model_skin_index number 0 - last skin index

The model skin index to use if the model support multiple skins. First skin is 0.

Warning: Zombie:Reloaded doesn't know how many skins a model has, make sure you use a valid index if modifying it. An invalid value might in worst case crash the server/client.

alpha_initial number 0 - 255

The initial transparency value on the player, where 255 is fully visible and 0 is invisible.

alpha_damaged number 0 - 255

Transparency on the player when a certain amount of damage is done. 255 is fully visible and 0 is invisible.

alpha_damage number 0 - 20000

How much damage that needs to be done before the players alpha changes from "aplha_spawn" to "aplha_damaged".

overlay_path text Max 256 characters

Optional. Overlay texture to be displayed at the player. It can be controlled by the night vision key ("n" by default). The path is relative to "cstrike/materials". Leave blank to disable.

nvgs text "yes" or "no"

Gives and turns on night vision on the player.

fov number 15 - 165

The field of view on the player. Note that the weapon hud disappear if FOV is anything else than 90.

has_napalm text "yes" or "no"

Human classes only. Specifies whether the human can trow napalm grenades or not.

napalm_time decimal 0.0 - 600.0

Zombie classes only. Specifies how long in seconds zombies will burn when hit by napalm grenades. 0.0 or a negative value will disable this feature on the current class. This attribute has no effect on human classes.

immunity_mode text One of the options below

An immunity mode is a mode where the class is resistent of a certain type of damage or action. Basically this is infections, knock back and bullet/explosion damage.

Be careful when using certain immunity modes. The class may become very strong (or completely invulnerable) which may break the game balance.

But it's also possible to spice up the game by letting zombies hurt humans a bit ("infect" mode) or allowing use of temporary shields.

none No immunity mode. Instant infection of humans.
kill Humans only. Humans will die instantly instead of turning zombies when attacked by zombies.
full Completely immune. Careful with this mode, it will break the game. Humans can't be infected and zombies don't receive damage or knock back. Admin commands may override this.
infect Humans only. Humans are immune to infections until HP go below a threshold (immunity_amount value). If you set the threshold to zero zombies can stab humans to death. If you set the threshold too high (higher than initial HP) humans can't be infected (similar to "full" immunity mode).
damage Zombies only. Zombies are immune to damage from humans/ grenades, but are still vulnerable to knock back. Since damage is blocked, zombies aren't slowed down by bullet hits, but knock back alone. You might need to increase knock back a bit.
delay Humans only. Delay infection for a certain amount of seconds (immunity_amount value). There's no notification, so humans need to be careful.

Subsequent zombie attacks will reduce the delay time with the number of seconds specified in the immunity_cooldown attribute. If you don't want subsequent attack to count, set immunity_cooldown to 0. This will make the human immune to further attacks, but he will be infected when the time is up - unless the human suicides (which can be blocked).
shield This is a temporary immunity mode which is activated by the player with the zshield command. It will give a shield against infections (humans) or knock back (zombies) for a certain amount of seconds (immunity_amount value).

It also has a cooldown delay before the shield can be deployed again. By setting this delay very high (longer than the round time) the shield can only be used once.
immunity_amount number 0 - 300, or a positive number

Immunity data value. The value depends on which immunity mode that's in use:

infect HP threshold value. When the human's HP go below this value he will become vulnerable to infection.
delay Number of seconds to delay infection since the first attack from a zombie.
shield Number of seconds the shield is active.
immunity_cooldown number 0 - 300, or a positive number

Number of seconds before temporary immunity actions can be used again. Usage depends on immunity mode:

delay Number of seconds to reduce the delay before infection. Set this to 0 to block subsequent attacks, or a high value (enough to eliminate the delay completely) to allow instant infection on second attack.
shield Number of seconds the the player has to wait before the shield is available again. Set this to a high value (longer than the round time) to allow one use only.
no_fall_damage text "yes" or "no"

Disables fall damange on the player. It does not block other damage types like explosions or damage from moving objects.

health number 0 - 100000

Initial health points on the player.

health_regen_interval decimal 0.0 - 900.0

The health regeneration interval, in seconds. Use 0.0 to disable regeneration.

health_regen_amount number 0 - 10000

How many health points to give per interval. Regeneration stops when the players health is above the initial health.

health_infect_gain number 0 - 20000

Zombie classes only. How many health points to give the zombie each time it infect a human.

kill_bonus number 0 - 16

Zombie classes only. How many extra points to give the killer of this zombie. If this is 0, the default value of 1 point will be given.

speed decimal -200.0 - 1750.0 | 10.0 - 2000.0

The player's running speed.

Note: The limits of this attribute depends on the speed method used. In LMV-mode the speed values are absolute, but in prop-mode values are offsets from normal speed at 250 (the class speed value is just added to this value). See the table below for limits:

Speed method Min Max CS:S default
LMV 10.0 2000.0 300.0
prop -200.0 1750.0 0.0

Formula for converting LMV speed into a prop speed offset:

prop speed offset = ((lmv speed / 300) * 250) - 250

This calculation can be done directly on a calculator, without any use of parentheses (they aren't needed in this one anyways).

knockback decimal -30.0 - 30.0

Zombie classes only. Force to apply on the zombie when shot at. The zombie is pushed in the same direction as the bullet.

jump_height decimal 0.0 - 5.0

Jump height multiplier. Extra upward boost when jumping. If 1.0 or 0.0 no boost will be applied.

jump_distance decimal 0.0 - 5.0

Jump distance multiplier. Extra forward boost when jumping. If 1.0 or 0.0 no boost will be applied.

Class Requirements

At least one zombie class and one human class with no special flags set is required. Otherwise the plugin will fail to load.

Requirements:

  • At least one human class (teamid 1).
  • At least one zombie class (teamid 0).
  • One of the classes in each team must have "team_default" set to "yes".
  • In addition both above classes shouldn't have special flags or groups set. They must be clean classes, which is "flags" set to "0" and "group" set to "".
  • All other attributes must have valid values. See Class Attributes (3.7.2).

Errors are logged to SourceMod error logs if it can't parse the file or if class attributes have invalid values.

In case of incorrect values a warning will be logged and the class will be disabled. There will be a log entry for each attribute that failed validation.

Note that class indexes start at zero and include all classes that aren't commented out in the class configuration.

Class Console Variables

There are several console variables to set default class settings for players. Place these console variables in the main configuration file:

cfg/sourcemod/zombiereloaded/zombiereloaded.cfg

And/or in a map config file:

cfg/sourcemod/zombiereloaded/<map name>[.post].cfg

Example map config files:

cfg/sourcemod/zombiereloaded/zm_panic.cfg
cfg/sourcemod/zombiereloaded/zm_panic.post.cfg

Class Console Variables
Console variable: Default:
zr_config_path_playerclasses "configs/zr/playerclasses.txt"

Specifies what class configuration file to load. Several class templates can be used with map configurations.

Path is relative to "sourcemod".

If used in map configuration files this console variable must be placed in pre map configuration files. Post configuration files won't have any effect because the class module is already done loading.

zr_classes_menu_spawn 0

Re-display class menu every spawn.

Options:
0 or 1

zr_classes_menu_join 0

Display class selection menu when a player spawn for the first time.

Options:
0 or 1

zr_classes_menu_autoclose 1

Automatically close class selection menu after selecting a class.

Options:
0 or 1

zr_classes_random 0

Assign random classes to all players each round.

This setting overrides zr_classes_save.

Options:
0 or 1

zr_classes_change_timelimit 20

The time limit to change human classes with instant change after spawning. So humans don't have to set class before spawning. Time is in seconds.

zr_classes_save 1

Save players' class selections in server cookies. Class selections are restored next time players connect.

This setting overrides zr_classes_default_*, but on first-time connecting players the default classes are assigned.

This setting also override zr_classes_*_select. If players have saved class indexes in cookies they will be restored.

Disabling this option won't erase saved settings, they just won't be restored when players connect.

Options:
0 or 1

zr_classes_default_zombie "random"

Default zombie class selected for all players when they connect.

Options:

<class name>Specify a class name to use as default zombie.
"default"Use the default class in the class configuration.
"random"Select a random zombie class from the class configuration.
zr_classes_default_mother_zombie "motherzombies"

Default mother zombie class to be set on mother zombies. If no mother zombie class exist it will use the class selected by the player.

Options:

<class name>Specify a class name to use as default mother zombie.
"random"Select a random regular zombie class.
"motherzombies"Select a random zombie class with mother zombie flag.
"disabled"No change. Use the zombie class selected by the player.
zr_classes_default_human "random"

Default human class selected for all players when they connect.

Options:

<class name>Specify a class name to use as default human.
"default"Use the default class in the class configuration.
"random"Select a random human class from the class configuration.
zr_classes_default_admin "random"

Note: This feature is incomplete!

Default admin-mode class selected for all players when they connect, if found. This feature is incomplete and ignored.

Do not confuse this with admin-only classes. Admin-mode is a special spawn mode for admins.

Options:

<class name>Specify a class name to use as default admin-mode class.
"default"Use the default class in the class configuration.
"random"Select a random admin-mode class from the class configuration.
zr_classes_zombie_select 1

Allow players to select zombie classes. Disable this option to force certain classes on players depending on what zr_classes_default_zombie is set to.

Options:
0 or 1

zr_classes_human_select 1

Allow players to select human classes. Disable this option to force certain classes on players depending on what zr_classes_default_human is set to.

Options:
0 or 1

zr_classes_admin_select 1

Note: This feature is incomplete!

Allow admins to select admin classes. Disable this option to force certain classes on admins depending on what zr_classes_default_admin is set to, - and if admin mode is enabled on the player.

Options:
0 or 1

zr_classes_speed_method "prop"

Speed method to use when setting player speed.

Options:

"lmv"Modifies speed with the lagged movement value. This is the old method and is available for compatibility reasons.
"prop"Modifies speed with the players' speed property.
zr_classes_overlay_toggle 1

Allow players to toggle class overlay.

Options:
0 or 1

zr_classes_overlay_togglecmds nightvision

List of commands to hook that players can use to toggle class overlay. [Dependency: zr_classes_overlay_toggle | Delimiter: ", "]

zr_classes_overlay_default 1

Default class overlay toggle state set on connecting player.

Options:
0 or 1

Modifying Class Attributes

Classes can be modified after they're loaded. This is useful in map configs to do stuff like scaling knockback to tune map balance.

All attributes can be modified, and some can also be scaled with a multiplier. The value in the original class cache is multiplied with the specified value and written back to the modified cache.

When multiplying, the value is always based on the original value, not multiplying the earlier multiplied value. This also makes it easy to restore the original value.

Note:These commands must be used in a post map config files, otherwise they won't have any effect because class data isn't loaded yet.

Modifying Class Command
Syntax:
zr_class_modify <class|team> <attribute> <value> [is_multiplier]

Modify settings on one or more classes.

Parameters:

class|team The class to modify. Can be any valid class name, or one of the following team names:
"all", "humans", "zombies" or "admins".
attribute The name of the class attribute to modify.
value Value to set, or multiplier if a multiplier.
is_multiplier Optional. Specifies wether the original value should be multiplied by the specified value. Default is false.

Attribute Multipliers

Making a balanced zombie map is difficult, and all maps have different balance. The knock back and other settings may work fine on one map, but not on other maps. This is where multipliers are useful.

With class attribute multipliers, numeric class attributes can be scaled and configured with map configuration files. There's a set of multipliers for both humans and zombies.

Warning: Currently these multipliers aren't validated, so using too high or negative values may cause unexpected behaviour, or even crash the plugin.

Attribute multipliers are set using this console command:

Attribute Multiplier Command
Syntax:
zr_class_set_multiplier <team> <attribute> <value>

Sets the multiplier on a class attribute.

Parameters:

team What multiplier set to use. Options:
"zombies" or "humans"
attribute A numeric class attribute. See Class Attributes (3.7.2) for details on attributes. Valid attribute multipliers:
  • health
  • health_regen_interval
  • health_regen_amount
  • speed
  • jump_height
  • jump_distance
Multipliers for zombies only:
  • napalm_time
  • health_infect_gain
  • knockback
value Value to set, or multiplier if a multiplier.

Multipliers can also be adjusted in the zombie admin menu, but the changes aren't saved. The menu is useful for finding the correct value, and then use it in a map configuration file.

Reloading Attributes

While testing or adjusting class attributes they must be reloaded before they will be effective. This only applies to players who already are the same class.

Reload Attributes Command
Syntax:
zr_class_reload <target>

Refreshes the player cache and reloads class attributes on one or more players.

Parameters:

targetTarget player(s) to refresh cache on. A name or a SourceMod target specifier.

Dumping Attributes

For debug purposes class attributes also can be dumped.

Dump Attributes Command
Syntax:
zr_class_dump <cachetype> <index|targetname>

Dumps class data at a specified index in the specified cache.

Parameters:

cachetype Cache to read from. Cache types:
"original"Unmodified raw class data.
"modified"Modified class data with multipliers.
"player"Player cache, with multipliers.
index|targetname Class index, or name of player if "player" cache type is used.

Dumping Multipliers

Dumping multipliers is another command for debug purposes. It will dump the current state of multipliers.

Dump Multipliers Command
Syntax:
zr_class_dump_multipliers <team>

Dumps class attribute multipliers for the specified team.

Parameters:

teamThe multiplier set to dump. Valid options are:
"humans" or "zombies"