SA-MP Forums Archive
Formating - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Formating (/showthread.php?tid=542617)



Formating - ShoortyFl - 20.10.2014

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;
}



Re: Formating - caoraivoso3 - 20.10.2014

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


Re: Formating - ShoortyFl - 20.10.2014

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;
}



Re: Formating - ShoortyFl - 21.10.2014

anyone ?