public void ShowPlayersMenu(int client)
{
Menu hMenu = new Menu(OnMainPlayersDisplay);
g_bSayCMD[client] = false;
char buffName[64], iId[4];
Format(buffName, sizeof(buffName), "%T", "Select player title", client);
hMenu.SetTitle(buffName);
for(int i = 1; i <= MaxClients; i++) if(IsValidClient(i))
{
AdminId id = GetUserAdmin(i);
Format(buffName, sizeof(buffName), "%T %N", (client == i ? "Me" : (id != INVALID_ADMIN_ID ? "Admin" : "Player")), client, i);
IntToString(i, iId, sizeof(iId));
hMenu.AddItem(iId, buffName);
}
hMenu.Display(client, MENU_TIME_FOREVER);
}
public int OnMainPlayersDisplay(Menu hMenu, MenuAction action, int client, int item)
{
switch(action)
{
case MenuAction_Cancel:
{
// if(item == MenuCancel_Interrupted) CreateTimer(0.08, MenuRestartOnClosed, client);
ShowMainMenu(client);
}
case MenuAction_Select:
{
char Victim[4], buff[32], buffTrans[128];
hMenu.GetItem(item, Victim, sizeof(Victim));
for(int poss = 0; poss < 4; poss++) if(iCurrectBoolDenial[client][poss])
{
// TrimString(iCmd[client][poss]);
iVictim[client] = StringToInt(Victim);
Format(buff, sizeof(buff), "\"#%i\"", GetClientUserId(iVictim[client]));
ReplaceString(iCmd[client][poss], sizeof(iCmd), "{Victim}", buff, false);
if(iReason[client][0] == '#') Format(buffTrans, sizeof(buffTrans), "\"%T\"", iReason[client], iVictim[client]);
else Format(buffTrans, sizeof(buffTrans), "\"%s\"", iReason[client]);
ReplaceString(iCmd[client][poss], sizeof(iCmd), "{Reason}", buffTrans, false);
Format(buff, sizeof(buff), "\"%i\"", iReadyCount[client][poss]);
ReplaceString(iCmd[client][poss], sizeof(iCmd), "{Count}", buff, false);
Format(buff, sizeof(buff), "\"#%i\"", client);
ReplaceString(iCmd[client][poss], sizeof(iCmd), "{Admin}", buff, false);
// PrintToChat(client, "%s", iCmd[client][poss]);
ShowConfirmMenu(client);
}
}
}
}