Problem with /questions
#1

This is the command:
PHP код:
CMD:questions(playerid, params[])
{
    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(playerid, DIALOG_BANK_STAT, DIALOG_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, "|") && x < 6)
    {
        new
            
query1[128],
            
query2[128]
        ;
        
query1 = query;
        
query2 = query;
        
strmid(query1, query, 0, strfind(query, "|"));
        new
            
len2 = strlen(query1)
        ;
        
len2 += 1;
        
strmid(query2, query, len2, strlen(query));
        new
            
id = strval(query2)
        ;
        
format(string, sizeof(string), "%s{FF6347}From: {B1C8FB}%s\n{FF6347}Question: {B1C8FB}%s\n{FFFFFF}______________\n", string, GetNameThroughUID(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: 1 Guest(s)