Skip to content

Commit

Permalink
feat(convar): zr_roundend_authid_type (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rushaway authored Nov 21, 2024
1 parent fe1ce34 commit b3040d0
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ Find all cvars details on [online docs](https://srcdslab.github.io/sm-plugin-zom
- zr_roundend_overlays_zombie - "overlays/zr/zombies_win - Overlay, relative to \"materials\" folder, to display when zombies win the round. [Dependency: zr_roundend_overlay]
- zr_roundend_balance_teams - "1" - Balances the team every time the round ends. Disable this if you use something else to balance teams.
- zr_roundend_zombies_win - "1" - Should zombies win if roundtime runs out.
- zr_roundend_authid_type - "1" - AuthID type used [0 = Engine, 1 = Steam2, 2 = Steam3, 3 = Steam64]
- zr_account_cashfill - "1" - Reset player's cash each spawn.
- zr_account_cashfill_value - "12000" - Amount of cash to set player's account to. [Dependency: zr_account_cashfill]
- zr_account_cashdmg - "0" - Attacker receives amount of cash equivalent to the damage that was inflicted.
Expand Down
14 changes: 14 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3378,6 +3378,20 @@ <h4><a id="3.12.2">1. RoundEnd</a></h4>
0 or 1</p>
</td>
</tr>

<tr>
<td class="commandheader">zr_roundend_authid_type</td>
<td class="commandheader">1</td>
</tr>
<td class="indent" colspan="2">
<p>AuthID type used to display stats at round end. See <a href="https://sm.alliedmods.net/new-api/clients/AuthIdType">AuthIdType Enumeration</a></p>
<p>Options:<br />
0 = Engine<br />
1 = Steam2<br />
2 = Steam3<br />
3 = Steam64
</p>
</td>
</table></blockquote>


Expand Down
2 changes: 1 addition & 1 deletion src/addons/sourcemod/scripting/zombiereloaded.sp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

#include <sdkhooks>

#define VERSION "3.10.12"
#define VERSION "3.10.13"

// Comment this line to exclude version info command. Enable this if you have
// the repository and HG installed (Mercurial or TortoiseHG).
Expand Down
2 changes: 2 additions & 0 deletions src/addons/sourcemod/scripting/zr/cvars.inc
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ enum struct CvarsList
Handle CVAR_ROUNDEND_OVERLAY_HUMAN;
Handle CVAR_ROUNDEND_BALANCE_TEAMS;
Handle CVAR_ROUNDEND_ZOMBIES_WIN;
Handle CVAR_ROUNDEND_AUTHID_TYPE;
Handle CVAR_INFECT_SPAWNTIME_MIN;
Handle CVAR_INFECT_SPAWNTIME_MAX;
Handle CVAR_INFECT_CONSECUTIVE_BLOCK;
Expand Down Expand Up @@ -386,6 +387,7 @@ void CvarsCreate()
g_hCvarsList.CVAR_ROUNDEND_OVERLAY_ZOMBIE = CreateConVar("zr_roundend_overlays_zombie", "overlays/zr/zombies_win", "Overlay, relative to \"materials\" folder, to display when zombies win the round. [Dependency: zr_roundend_overlay]");
g_hCvarsList.CVAR_ROUNDEND_BALANCE_TEAMS = CreateConVar("zr_roundend_balance_teams", "1", "Balances the team every time the round ends. Disable this if you use something else to balance teams.");
g_hCvarsList.CVAR_ROUNDEND_ZOMBIES_WIN = CreateConVar("zr_roundend_zombies_win", "1", "Should zombies win if roundtime runs out.");
g_hCvarsList.CVAR_ROUNDEND_AUTHID_TYPE = CreateConVar("zr_roundend_authid_type", "1", "AuthID type used [0 = Engine, 1 = Steam2, 2 = Steam3, 3 = Steam64]", FCVAR_NONE, true, 0.0, true, 3.0);


// ===========================
Expand Down
4 changes: 3 additions & 1 deletion src/addons/sourcemod/scripting/zr/roundend.inc
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,8 @@ void RoundEndOnRoundEnd(int reason)

void RoundEndDisplayStats()
{
AuthIdType authType = view_as<AuthIdType>(GetConVarInt(g_hCvarsList.CVAR_ROUNDEND_AUTHID_TYPE));

for(int player = 1; player <= MaxClients; player++)
{
if(!IsClientInGame(player) || (IsFakeClient(player) && !IsClientSourceTV(player)))
Expand All @@ -306,7 +308,7 @@ void RoundEndDisplayStats()
FormatEx(sPlayerID, sizeof(sPlayerID), "%d", GetClientUserId(player));
FormatEx(sPlayerName, sizeof(sPlayerName), "\"%N\"", player);

if(!GetClientAuthId(player, AuthId_Steam2, sPlayerAuth, sizeof(sPlayerAuth)))
if(!GetClientAuthId(player, authType, sPlayerAuth, sizeof(sPlayerAuth)))
FormatEx(sPlayerAuth, sizeof(sPlayerAuth), "STEAM_ID_PENDING");

if(IsPlayerAlive(player))
Expand Down

0 comments on commit b3040d0

Please sign in to comment.