31.07.2016, 16:30
This my code for command to show online/offline members
members2 is for The second dialog "Next", Everything is fine but it doesn't show the last member, example members are 17, it shows 14 in first page and 2 in second page, 1 missing
Any help would be appreciated, thanks!
PHP код:
format(string, 256, "SELECT Name FROM Users WHERE Clan = %d", GetPlayerClan(playerid, g_SQL));
mysql_query(g_SQL, string);
for(new i=0; i<GetMaxMembers(GetPlayerClan(playerid, g_SQL), g_SQL); i++)
{
new name[25], s[48];
cache_get_field_content(i, "Name", name);
if(IsPlayerConnected(GetPlayerId(name)))
{
switch(i)
{
case 0..14:
{
format(s, 24+24, "%s\t%s\t{00FF2F}Online\n", name, GetRankName(GetPlayerClan(playerid, g_SQL), GetPlayerRank(GetPlayerId(name), g_SQL), g_SQL));
strcat(members, s);
}
case 15..28:
{
format(s, 24+24, "%s\t%s\t{00FF2F}Online\n", name, GetRankName(GetPlayerClan(playerid, g_SQL), GetPlayerRank(GetPlayerId(name), g_SQL), g_SQL));
strcat(members2, s);
}
}
}
else switch(i)
{
case 0..14:
{
format(s, 24+24, "%s\t%s\t{FF0000}Offline\n", name, GetRankName(GetPlayerClan(playerid, g_SQL), GetOfflineRank(name, g_SQL), g_SQL));
strcat(members, s);
}
case 15..28:
{
format(s, 24+24, "%s\t%s\t{FF0000}Offline\n", name, GetRankName(GetPlayerClan(playerid, g_SQL), GetOfflineRank(name, g_SQL), g_SQL));
strcat(members2, s);
}
}
}
ShowPlayerDialog(playerid, 13, DIALOG_STYLE_TABLIST, "Clan Members", members, "Next", "Cancel");
Any help would be appreciated, thanks!