Skip to content
This repository has been archived by the owner on Jun 16, 2024. It is now read-only.

Commit

Permalink
Show recently reported players as a disabled menu item
Browse files Browse the repository at this point in the history
  • Loading branch information
Impact123 committed Mar 20, 2019
1 parent 27261d6 commit 9cf8cea
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
5 changes: 5 additions & 0 deletions gameserver/calladmin.phrases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,9 @@
"de" "Du hast eine falsche Melde-id benutzt"
"ru" "Указан неправильный ID жалобы"
}
"CallAdmin_RecentlyReported"
{
"en" "Recently reported"
"de" "Kürzlich gemeldet"
}
}
17 changes: 13 additions & 4 deletions gameserver/calladmin.sp
Original file line number Diff line number Diff line change
Expand Up @@ -1125,20 +1125,29 @@ int GetTotalTrackers()

void ShowClientSelectMenu(int client)
{
char sName[MAX_NAME_LENGTH];
char sBuffer[128];
char sID[24];

Menu menu = new Menu(MenuHandler_ClientSelect);
menu.SetTitle("%T", "CallAdmin_SelectClient", client);

for (int i; i <= MaxClients; i++)
{
if (i != client && LastReportedTimeCheck(i) && IsClientValid(i) && !IsFakeClient(i) && !IsClientSourceTV(i) && !IsClientReplay(i) && Forward_OnDrawTarget(client, i))
if (i != client && IsClientValid(i) && !IsFakeClient(i) && !IsClientSourceTV(i) && !IsClientReplay(i) && Forward_OnDrawTarget(client, i))
{
GetClientName(i, sName, sizeof(sName));
GetClientName(i, sBuffer, sizeof(sBuffer));
Format(sID, sizeof(sID), "%d", GetClientSerial(i));

menu.AddItem(sID, sName);
if (LastReportedTimeCheck(i))
{
menu.AddItem(sID, sBuffer);
}
else
{
// Player was recently reported, their item is disabled
Format(sBuffer, sizeof(sBuffer), "%s (%T)", sBuffer, "CallAdmin_RecentlyReported", client);
menu.AddItem(sID, sBuffer, ITEMDRAW_DISABLED);
}
}
}

Expand Down

0 comments on commit 9cf8cea

Please sign in to comment.