Problem with /questions
#1

This is the command:
PHP код:
CMD:questions(playeridparams[])
{
    if(!
PlayerInfo[playerid][pTester] && !PlayerInfo[playerid][pAdmin])
        return 
0;
    new
        
string[2048],
        
query[128]
     ;
    
mysql_query("SELECT * FROM `reports` WHERE `type` = '0'");
    
mysql_store_result();
    if(
mysql_num_rows() == 0)
        return 
ShowPlayerDialog(playeridDIALOG_BANK_STATDIALOG_STYLE_MSGBOX"{24FF0A}Supporter - {FFFFFF}Questions""No questions have been submitted yet""OK""");
    
mysql_free_result();
    
format(string,sizeof(string),"{FF6347}QUESTIONS:\n");
    
format(query,sizeof(query),"SELECT `string`,`from` FROM `reports` WHERE `type` = '0' ORDER BY `id` DESC");
    
mysql_query(query);
    
mysql_store_result();
    new
        
x=0
    
;
    while(
mysql_fetch_row(query"|") && 6)
    {
        new
            
query1[128],
            
query2[128]
        ;
        
query1 query;
        
query2 query;
        
strmid(query1query0strfind(query"|"));
        new
            
len2 strlen(query1)
        ;
        
len2 += 1;
        
strmid(query2querylen2strlen(query));
        new
            
id strval(query2)
        ;
        
format(stringsizeof(string), "%s{FF6347}From: {B1C8FB}%s\n{FF6347}Question: {B1C8FB}%s\n{FFFFFF}______________\n"stringGetNameThroughUID(id), query1);
        
printf("%s",string);
        
x++;
        
printf("%i",x);
    }
    
printf("%s",string);
    
mysql_free_result();
    
ShowPlayerDialog(playerid,DIALOG_BANK_STAT,DIALOG_STYLE_MSGBOX,"{24FF0A}Supporter - {FFFFFF}Questions",string,"OK","");
    return 
1;

It only shows the last message, can anyone spot a problem in my code?
Reply


Messages In This Thread
Problem with /questions - by [IL]HeHu - 03.10.2011, 10:34
Re: Problem with /questions - by System64 - 03.10.2011, 11:12
Re: Problem with /questions - by [IL]HeHu - 03.10.2011, 11:15
Re: Problem with /questions - by System64 - 03.10.2011, 11:16
Re: Problem with /questions - by [IL]HeHu - 03.10.2011, 11:53
Re: Problem with /questions - by [IL]HeHu - 03.10.2011, 14:24

Forum Jump:


Users browsing this thread: 3 Guest(s)