Skip to content

Commit

Permalink
Implement CVar mp_max_alive_name_changes
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyShorokhov committed Sep 1, 2021
1 parent 5aec8aa commit 9a7707a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ This means that plugins that do binary code analysis (Orpheu for example) probab
| mp_fadetoblack | 0 | 0 | 2 | Observer's screen will fade to black on kill event or permanent.<br/> `0` No fade.<br/>`1` Fade to black and won't be able to watch anybody.<br/>`2` fade to black only on kill moment. |
| mp_falldamage | 1 | 0 | 1 | Damage from falling.<br/>`0` disabled <br/>`1` enabled |
| sv_allchat | 1 | 0 | 1 | Players can receive all other players text chat, team restrictions apply<br/>`0` disabled <br/>`1` enabled |
| mp_max_alive_name_changes | -1 | -1 | - | Maximum amount of nickname changes before next respawn<br/>`-1` unlimited (default behaviour) <br/>`0` Allow to change only at spawn </br>`>0` Allow to change arbitrary amount of nicks |
</details>

## How to install zBot for CS 1.6?
Expand Down
8 changes: 8 additions & 0 deletions dist/game.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -462,3 +462,11 @@ mp_free_armor 0
//
// Default value: "0"
sv_allchat 0
// Maximum amount of nickname changes before next respawn.
// -1 - unlimited (default behaviour)
// 0 - Allow to change only at spawn
// >0 - Allow to change arbitrary amount of nicks
//
// Default value: "-1"
mp_max_alive_name_changes -1
2 changes: 2 additions & 0 deletions regamedll/dlls/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ cvar_t t_default_weapons_secondary = { "mp_t_default_weapons_secondary", "
cvar_t t_default_weapons_primary = { "mp_t_default_weapons_primary", "", 0, 0.0f, nullptr };
cvar_t free_armor = { "mp_free_armor", "0", 0, 0.0f, nullptr };
cvar_t allchat = { "sv_allchat", "0", 0, 0.0f, nullptr };
cvar_t max_alive_name_changes = { "mp_max_alive_name_changes", "-1", 0, 0.0f, nullptr };

void GameDLL_Version_f()
{
Expand Down Expand Up @@ -387,6 +388,7 @@ void EXT_FUNC GameDLLInit()
CVAR_REGISTER(&t_default_weapons_primary);
CVAR_REGISTER(&free_armor);
CVAR_REGISTER(&allchat);
CVAR_REGISTER(&max_alive_name_changes);

// print version
CONSOLE_ECHO("ReGameDLL version: " APP_VERSION "\n");
Expand Down
1 change: 1 addition & 0 deletions regamedll/dlls/game.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ extern cvar_t t_default_weapons_secondary;
extern cvar_t t_default_weapons_primary;
extern cvar_t free_armor;
extern cvar_t allchat;
extern cvar_t max_alive_name_changes;

#endif

Expand Down

0 comments on commit 9a7707a

Please sign in to comment.