Tablist Headers
#1

Below is my code that I use to display all of the Helpers are online. As you can see, I am using a Header, however, if there are more than 1 helper, the headers is getting fucked up. Instead of the header being just on top, it shows up one more time as part of the list.

Код:
foreach(new i: Player)
{
    if(PlayerInfo[i][pHelper] >= 1 && PlayerInfo[i][pAdmin] < 2)
    {
        new tdate[11], thour[9], i_timestamp[3];
        getdate(i_timestamp[0], i_timestamp[1], i_timestamp[2]);
                
        format(tdate, sizeof(tdate), "%d-%02d-%02d", i_timestamp[0], i_timestamp[1], i_timestamp[2]);
        format(thour, sizeof(thour), "%02d:00:00", hour);

        if(PlayerInfo[i][pHelper] == 1)
        {
            format(szDialog, sizeof(szDialog), "%s{FFFFFF}Helper\t%s\t%d\t%d\n", szDialog, GetPlayerNameEx(i), ReportHourCount[i], ReportCount[i]);
        }
        if(PlayerInfo[i][pHelper] == 2)
        {
            format(szDialog, sizeof(szDialog), "%s{FFFFFF}Senior Helper\t%s\t%d\t%d\n", szDialog, GetPlayerNameEx(i), ReportHourCount[i], ReportCount[i]);
        }
        if(PlayerInfo[i][pHelper] == 3)
        {
            format(szDialog, sizeof(szDialog), "%s{FFFFFF}Head Helper\t%s\t%d\t%d\n", szDialog, GetPlayerNameEx(i), ReportHourCount[i], ReportCount[i]);
        }
        format(szHeader, sizeof(szHeader), "Rank\tName\tHourly Requests\tRequests Today\n");
        strins(szDialog, szHeader, 0);
        ShowPlayerDialog(playerid, DIALOG_NOTHING, DIALOG_STYLE_TABLIST_HEADERS, "Helpers Online", szDialog, "Close", "");
    }
}
Reply
#2

The two lines that stand out are:
PHP код:
foreach(new iPlayer
and
PHP код:
ShowPlayerDialog(playeridDIALOG_NOTHINGDIALOG_STYLE_TABLIST_HEADERS"Helpers Online"szDialog"Close"""); 
Or otherwise written as: for each player online, show the dialog again to playerid. The ShowPlayerDialog line and the headers should be outside of the loop.
Reply
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
The two lines that stand out are:
PHP код:
foreach(new iPlayer
and
PHP код:
ShowPlayerDialog(playeridDIALOG_NOTHINGDIALOG_STYLE_TABLIST_HEADERS"Helpers Online"szDialog"Close"""); 
Or otherwise written as: for each player online, show the dialog again to playerid. The ShowPlayerDialog line and the headers should be outside of the loop.
Thanks for your help, it worked.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)