How to print in a dialog
#1

When i try to print it just dont help me its working on SendClientMessage 2 names are shown in an dialog only one;

like this heading PlayerName Rank Status
Name Rank Status
PHP код:
CMD:clanmembers(playerid)
{
    new 
str[128], Cache:members;
    new 
minfo[500];
    
mysql_format(gSQLstrsizeof(str), "SELECT * FROM `Clan_Members` WHERE `clanid`= %d",GetPlayerClanId(playerid));
    
members mysql_query(gSQLstrtrue);
    new 
count cache_num_rows();
    if(
count 0)
    {
        
//new str1[150];
        //format(str1,sizeof(str1),"Count=%d",count);
        //SendClientMessage(playerid,COLOR_RED,str1);
        
new log,i;
        new 
Name[150],Rank[150],Status[150];
        for(
0counti++)
        {
            
cache_get_value_name(i"playername"Name);
            
cache_get_value_name(i"playerclanrank"Rank);
            
cache_get_value_int(i"IsOnline"log);
            if(
log == 0)
            {
                
Status "{FF0000}Offline";
            }
            else if(
log == 1)
            {
                
Status "{00CC00}Online";
            }
            
format(minfo,sizeof(minfo),"\n%s\t  %s\t %s",Name,Rank,Status);
            
SendClientMessage(playeridCOLOR_YELLOWminfo);
            
//ShowPlayerDialog(playerid, 123, DIALOG_STYLE_LIST," {FFFFFF}-{00FF00} Clan Members",minfo, "Next", "Close");
        
}
    }
    
cache_delete(members);
    return 
1;

Reply
#2

PHP код:
CMD:clanmembers(playerid

    new 
str[128], Cache:members
    new 
minfo[500]; 
    
mysql_format(gSQLstrsizeof(str), "SELECT * FROM `Clan_Members` WHERE `clanid`= %d",GetPlayerClanId(playerid)); 
    
members mysql_query(gSQLstrtrue); 
    new 
count cache_num_rows(); 
    new 
string[1024];
    if(
count 0
    { 
        
//new str1[150]; 
        //format(str1,sizeof(str1),"Count=%d",count); 
        //SendClientMessage(playerid,COLOR_RED,str1); 
        
new log,i
        new 
Name[150],Rank[150],Status[150]; 
        for(
0counti++) 
        { 
            
cache_get_value_name(i"playername"Name); 
            
cache_get_value_name(i"playerclanrank"Rank); 
            
cache_get_value_int(i"IsOnline"log); 
            if(
log == 0
            { 
                
Status "{FF0000}Offline"
            } 
            else if(
log == 1
            { 
                
Status "{00CC00}Online"
            } 
            
format(minfo,sizeof(minfo),"\n%s\t  %s\t %s",Name,Rank,Status);
            
strcat(stringminfo);
            
//SendClientMessage(playerid, COLOR_YELLOW, minfo); 
        
}
        
ShowPlayerDialog(playerid123DIALOG_STYLE_LIST," {FFFFFF}-{00FF00} Clan Members",string"Next""Close"); 
    } 
    
cache_delete(members); 
    return 
1

Reply
#3

How to bring the heading's.. Like PlayerName Rank Status... Cant add in dialog section
Reply
#4

use DIALOG_STYLE_TABLIST_HEADERS

PHP код:
CMD:clanmembers(playerid

    new 
str[128], Cache:members
    new 
minfo[500]; 
    
mysql_format(gSQLstrsizeof(str), "SELECT * FROM `Clan_Members` WHERE `clanid`= %d",GetPlayerClanId(playerid)); 
    
members mysql_query(gSQLstrtrue); 
    new 
count cache_num_rows(); 
    new 
string[1024];
    if(
count 0
    { 
        
//new str1[150]; 
        //format(str1,sizeof(str1),"Count=%d",count); 
        //SendClientMessage(playerid,COLOR_RED,str1); 
        
new log,i
        new 
Name[150],Rank[150],Status[150]; 
        for(
0counti++) 
        { 
            
cache_get_value_name(i"playername"Name); 
            
cache_get_value_name(i"playerclanrank"Rank); 
            
cache_get_value_int(i"IsOnline"log); 
            if(
log == 0
            { 
                
Status "{FF0000}Offline"
            } 
            else if(
log == 1
            { 
                
Status "{00CC00}Online"
            } 
            
format(minfo,sizeof(minfo),"\n%s\t  %s\t %s",Name,Rank,Status);
            
strcat(stringminfo);
            
//SendClientMessage(playerid, COLOR_YELLOW, minfo); 
        
}
        new 
string2[1024];
        
format(string2sizeof string2"PlayerName\t\tRank\t\tStatus\n%s"string);
        
ShowPlayerDialog(playerid123DIALOG_STYLE_TABLIST_HEADERS," {FFFFFF}-{00FF00} Clan Members",string2"Next""Close"); 
    } 
    
cache_delete(members); 
    return 
1

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)