Added CVar mp_location_area_info for display location area info in HUDs radio chat and below radar

This commit is contained in:
s1lentq 2024-04-07 16:41:56 +07:00
parent f711276d8a
commit 1ae0091947
6 changed files with 22 additions and 1 deletions

View File

@ -116,6 +116,7 @@ This means that plugins that do binary code analysis (Orpheu for example) probab
| mp_freezetime_duck | 1 | 0 | 1 | Allow players to duck during freezetime.<br/> `0` disabled<br/>`1` enabled | | mp_freezetime_duck | 1 | 0 | 1 | Allow players to duck during freezetime.<br/> `0` disabled<br/>`1` enabled |
| mp_freezetime_jump | 1 | 0 | 1 | Allow players to jump during freezetime.<br/> `0` disabled<br/>`1` enabled | | mp_freezetime_jump | 1 | 0 | 1 | Allow players to jump during freezetime.<br/> `0` disabled<br/>`1` enabled |
| mp_defuser_allocation | 0 | 0 | 2 | Give defuser on player spawn.<br/> `0` disabled<br/>`1` Random players. <br/>`2` All players. | | mp_defuser_allocation | 0 | 0 | 2 | Give defuser on player spawn.<br/> `0` disabled<br/>`1` Random players. <br/>`2` All players. |
| mp_location_area_info | 0 | 0 | 1 | Enable location area info.<br/> `0` disabled<br/>`1` enabled.<br/>Usually displayed in HUDs below radar or in radio chat as a prefix.<br/>`NOTE`: Navigation `maps/.nav` file required and should contain place names |
</details> </details>
## How to install zBot for CS 1.6? ## How to install zBot for CS 1.6?

10
dist/game.cfg vendored
View File

@ -575,3 +575,13 @@ mp_freezetime_jump "1"
// //
// Default value: "0" // Default value: "0"
mp_defuser_allocation "0" mp_defuser_allocation "0"
// Enable location area info
// Usually displayed in HUDs below radar or in radio chat as a prefix
// 0 - disabled (default behavior)
// 1 - enabled
//
// NOTE: Navigation maps/.nav file required and should contain place names
//
// Default value: "0"
mp_location_area_info "0"

View File

@ -3723,6 +3723,9 @@ void EXT_FUNC ServerActivate(edict_t *pEdictList, int edictCount, int clientMax)
#ifdef REGAMEDLL_ADD #ifdef REGAMEDLL_ADD
CSGameRules()->ServerActivate(); CSGameRules()->ServerActivate();
if (location_area_info.value)
LoadNavigationMap();
#endif #endif
} }

View File

@ -178,6 +178,7 @@ cvar_t legacy_vehicle_block = { "mp_legacy_vehicle_block", "1", 0,
cvar_t dying_time = { "mp_dying_time", "3.0", 0, 3.0f, nullptr }; cvar_t dying_time = { "mp_dying_time", "3.0", 0, 3.0f, nullptr };
cvar_t defuser_allocation = { "mp_defuser_allocation", "0", 0, 0.0f, nullptr }; cvar_t defuser_allocation = { "mp_defuser_allocation", "0", 0, 0.0f, nullptr };
cvar_t location_area_info = { "mp_location_area_info", "0", 0, 0.0f, nullptr };
void GameDLL_Version_f() void GameDLL_Version_f()
{ {
@ -441,6 +442,7 @@ void EXT_FUNC GameDLLInit()
CVAR_REGISTER(&freezetime_duck); CVAR_REGISTER(&freezetime_duck);
CVAR_REGISTER(&freezetime_jump); CVAR_REGISTER(&freezetime_jump);
CVAR_REGISTER(&defuser_allocation); CVAR_REGISTER(&defuser_allocation);
CVAR_REGISTER(&location_area_info);
// print version // print version
CONSOLE_ECHO("ReGameDLL version: " APP_VERSION "\n"); CONSOLE_ECHO("ReGameDLL version: " APP_VERSION "\n");

View File

@ -201,6 +201,7 @@ extern cvar_t assist_damage_threshold;
extern cvar_t freezetime_duck; extern cvar_t freezetime_duck;
extern cvar_t freezetime_jump; extern cvar_t freezetime_jump;
extern cvar_t defuser_allocation; extern cvar_t defuser_allocation;
extern cvar_t location_area_info;
#endif #endif

View File

@ -10083,7 +10083,11 @@ void CBasePlayer::UpdateLocation(bool forceUpdate)
const char *placeName = ""; const char *placeName = "";
if (pev->deadflag == DEAD_NO && AreBotsAllowed()) if (pev->deadflag == DEAD_NO && (
#ifdef REGAMEDLL_ADD
location_area_info.value ||
#endif
AreBotsAllowed()))
{ {
// search the place name where is located the player // search the place name where is located the player
Place playerPlace = TheNavAreaGrid.GetPlace(&pev->origin); Place playerPlace = TheNavAreaGrid.GetPlace(&pev->origin);