Skip to content

Commit 0902edd

Browse files
authored
Merge pull request #67 from Sarrus1/master
Fixed console spamming with Kento_RankMe
2 parents 97c46c7 + e02576a commit 0902edd

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

addons/sourcemod/scripting/hextags.sp

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ bool bMyJBWarden;
7070
bool bGangs;
7171
bool bSteamWorks = true;
7272
bool bHideTag[MAXPLAYERS+1];
73+
bool bHasRoundEnded;
7374

7475
int iRank[MAXPLAYERS+1] = {-1, ...};
7576
int iNextDefTag;
@@ -141,6 +142,7 @@ public void OnPluginStart()
141142
//Event hooks
142143
if (!HookEventEx("round_end", Event_RoundEnd))
143144
LogError("Failed to hook \"round_end\", \"sm_hextags_roundend\" won't produce any effect.");
145+
HookEvent("round_start", Event_RoundStart);
144146

145147
hVibilityCookie = RegClientCookie("HexTags_Visibility", "Show or hide the tags.", CookieAccess_Private);
146148
hSelTagCookie = RegClientCookie("HexTags_SelectedTag", "Selected Tag", CookieAccess_Private);
@@ -508,12 +510,18 @@ public Action RankMe_LoadTags(int client, int rank, any data)
508510

509511
public void Event_RoundEnd(Event event, const char[] name, bool dontBroadcast)
510512
{
513+
bHasRoundEnded = true;
511514
if (!cv_bParseRoundEnd.BoolValue)
512515
return;
513-
516+
514517
for (int i = 1; i <= MaxClients; i++)if (IsClientInGame(i))OnClientPostAdminCheck(i);
515518
}
516519

520+
public void Event_RoundStart(Event event, const char[] name, bool dontBroadcast)
521+
{
522+
bHasRoundEnded = false;
523+
}
524+
517525
public Action CP_OnChatMessage(int& author, ArrayList recipients, char[] flagstring, char[] name, char[] message, bool& processcolors, bool& removecolors)
518526
{
519527
Debug_Setup(true, false, false, true); // Disable chat.
@@ -1011,7 +1019,10 @@ public Action Timer_ForceTag(Handle timer)
10111019
if (StrEqual(sTag, selectedTags[i].ScoreTag))
10121020
continue;
10131021

1014-
LogMessage("%L was changed by an external plugin, forcing him back to the HexTags' default one!", i, sTag);
1022+
if (!bHasRoundEnded){
1023+
LogMessage("%L was changed by an external plugin, forcing him back to the HexTags' default one!", i, sTag);
1024+
}
1025+
10151026
CS_SetClientClanTag(i, selectedTags[i].ScoreTag);
10161027
}
10171028
}
@@ -1297,4 +1308,4 @@ public int Native_AddCustomSelector(Handle plugin, int numParams)
12971308
public int Native_RemoveCustomSelector(Handle plugin, int numParams)
12981309
{
12991310
return pfCustomSelector.RemoveFunction(plugin, GetNativeFunction(1));
1300-
}
1311+
}

0 commit comments

Comments
 (0)