SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 20/10/2014, 07:40 PM   #1
ShoortyFl
Huge Clucker
 
Join Date: Apr 2014
Location: Malibu, CA
Posts: 336
Reputation: 16
Default Formating

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

Code:
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;
}
ShoortyFl is offline   Reply With Quote
Old 20/10/2014, 08:10 PM   #2
caoraivoso3
High-roller
 
Join Date: Dec 2011
Location: WELCOME TO THE RICE FIELDS MOTHERFUCKER!!!1111
Posts: 1,190
Reputation: 35
Default Re: Formating

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
caoraivoso3 is offline   Reply With Quote
Old 20/10/2014, 10:23 PM   #3
ShoortyFl
Huge Clucker
 
Join Date: Apr 2014
Location: Malibu, CA
Posts: 336
Reputation: 16
Default Re: Formating

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

pawn Code:
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;
}
ShoortyFl is offline   Reply With Quote
Old 21/10/2014, 09:48 AM   #4
ShoortyFl
Huge Clucker
 
Join Date: Apr 2014
Location: Malibu, CA
Posts: 336
Reputation: 16
Default Re: Formating

anyone ?
ShoortyFl is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
String formating ajwar Scripting Help 3 01/11/2013 12:49 PM
Formating error Feastahashi Scripting Help 5 03/12/2012 06:42 PM
Formating a message? A7X_CEEJAY Scripting Help 2 18/06/2012 04:42 PM
Formating MySQL Raimis_R Help Archive 4 18/11/2010 03:46 PM


All times are GMT. The time now is 06:05 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.