Formating
#1

Well this function doesn't work correctly, it only shows offline members not the online ones

Код:
public OfflineMembers(playerid)
{
    new numrows = cache_get_row_count(konekt);
    new username[MAX_PLAYER_NAME], rank, str[25], sup[200];
    if(numrows)
    {
         for(new i; i <numrows; i++)
         {
         	cache_get_field_content(i, "Ime", username, 1, sizeof(username));
         	rank = cache_get_field_content_int(0,"Rank");
         	
         	if(rank == 0) { str = "RANK - 0"; }
         	else if(rank == 1) { str = "RANK - 1"; }
         	else if(rank == 2) { str = "RANK - 2"; }
         	else if(rank == 3) { str = "RANK - 3"; }
         	else if(rank == 4) { str = "RANK - 4"; }
         	else if(rank == 5) { str = "RANK - 5"; }
         	else if(rank == 6) { str = "RANK - 6"; }
         	
         	if(ReturnUser(username) != INVALID_PLAYER_ID)
		  	{
			  	format(sup, sizeof(sup), "{00C0FF}[ON]__________________[%s]______________[%s]", str, username);
		  	}
		  	format(sup, sizeof(sup), "{F81414}[OFF]_________________[%s]______________[%s]", str, username);
		}
    }
    SPD(playerid, DIALOG_ALLMEMBERS, DIALOG_STYLE_MSGBOX, "Svi Clanovi", sup, "Uredu", "");
    return 1;
}
Reply
#2

You are formatting the same string , sup, yoiu should ctrate two then pull them together, sru for not give you the example code dont have pc i am on tablet it is hard to write
Reply
#3

I've tried doing it this way, but its not working.

pawn Код:
public OfflineMembers(playerid)
{
    new numrows = cache_get_row_count(konekt);
    new username[MAX_PLAYER_NAME], rank, str[25], sup[200];
    if(numrows)
    {
         for(new i; i <numrows; i++)
         {
            cache_get_field_content(i, "Ime", username, 1, sizeof(username));
            rank = cache_get_field_content_int(0,"Rank");

            if(rank == 0) { str = "RANK - 0"; }
            else if(rank == 1) { str = "RANK - 1"; }
            else if(rank == 2) { str = "RANK - 2"; }
            else if(rank == 3) { str = "RANK - 3"; }
            else if(rank == 4) { str = "RANK - 4"; }
            else if(rank == 5) { str = "RANK - 5"; }
            else if(rank == 6) { str = "RANK - 6"; }

            if(ReturnUser(username) != INVALID_PLAYER_ID)
            {
                format(sup, sizeof(sup), "{00C0FF}[ON]__________________[%s]______________[%s]", str, username);
            }
            else format(sup, sizeof(sup), "{F81414}[OFF]_________________[%s]______________[%s]", str, username);
        }
    }
    SPD(playerid, DIALOG_ALLMEMBERS, DIALOG_STYLE_MSGBOX, "Svi Clanovi", sup, "Uredu", "");
    return 1;
}
Reply
#4

anyone ?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)