shavit-chat.sp - add dynamic {currentstylerank} variable and prepend '#' to style ranks

This commit is contained in:
mourningsickness 2025-08-01 15:51:11 -07:00 committed by GitHub
parent 3032818408
commit b0359f02e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1350,8 +1350,14 @@ void FormatChat(int client, char[] buffer, int size)
{
IntToString(iStyleRank, sStyleRank, 16);
}
FormatEx(sStyleBuf, 32, "{style%drank}", i);
FormatEx(sStyleBuf, 32, "#{style%drank}", i);
ReplaceString(buffer, size, sStyleBuf, sStyleRank);
if(i == Shavit_GetBhopStyle(client))
{
FormatEx(sStyleBuf, 32, "%s%s %s", iStyleRank > 0 ? "#" : "", sStyleRank, gS_StyleStrings[i].sStyleName);
ReplaceString(buffer, size, "{currentstylerank}", sStyleBuf);
}
}
int iRanked = Shavit_GetRankedPlayers();
@ -1607,8 +1613,14 @@ public int Native_GetPlainChatrank(Handle handler, int numParams)
{
IntToString(iStyleRank, sStyleRank, 16);
}
FormatEx(sStyleBuf, 32, "{style%drank}", i);
FormatEx(sStyleBuf, 32, "#{style%drank}", i);
ReplaceString(buf, sizeof(buf), sStyleBuf, sStyleRank);
if(i == Shavit_GetBhopStyle(client))
{
FormatEx(sStyleBuf, 32, "%s%s %s", iStyleRank > 0 ? "#" : "", sStyleRank, gS_StyleStrings[i].sStyleName);
ReplaceString(buf, sizeof(buf), "{currentstylerank}", sStyleBuf);
}
}
int iRanked = Shavit_GetRankedPlayers();