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
#2

try changing this:
pawn Код:
len2 += 1;
to this
pawn Код:
len2 + 1;
Reply
#3

Nah, won't work
Reply
#4

this:
pawn Код:
new
            id = strval(query2)
        ;
to
pawn Код:
new
            id = strlen(query2)
        ;
Reply
#5

Nah won't work either
Reply
#6

bump?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)