04.01.2016, 10:27
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", ""); } }