I can't figure out whats wrong with this. It used to work perfectly and now it isn't anymore. Nothing has been changed to it. When i type the command. It returns 0 and tells me unknown command
Код:
CMD:reports(playerid,params[])
{
printf("test");
new str[1024], string2[1024], string[1024], szQuery[128], status[25], reportid[25];
if(AdminLevel[playerid] >=2)
{
printf("test1");
for(new i = MAX_REPORTS; i > 0; i --)
{
printf("test2");
new reportstatus[5];
new DBResult:REPORTS_RESULT_FINAL;
format(szQuery, sizeof(szQuery), "SELECT * FROM `REPORTS` WHERE `ID` = '%d'", i);
REPORTS_RESULT_FINAL = db_query(LARP_DATABASE, szQuery);
printf("test3");
db_get_field_assoc(REPORTS_RESULT_FINAL, "ID", reportid, sizeof(reportid));
ReportInfo[i][ReportID] = strval(reportid);
db_get_field_assoc(REPORTS_RESULT_FINAL, "Status", reportstatus, sizeof(reportstatus));
db_get_field_assoc(REPORTS_RESULT_FINAL, "PlayerName", ReportInfo[i][ReportedName], 124);
db_get_field_assoc(REPORTS_RESULT_FINAL, "Reported", ReportInfo[i][ReportedBy], 124);
db_get_field_assoc(REPORTS_RESULT_FINAL, "Report", ReportInfo[i][ReportedReason], 124);
db_get_field_assoc(REPORTS_RESULT_FINAL, "Date", ReportInfo[i][ReportedDate], 124);
if(ReportInfo[i][ReportID] != 0)
{
printf("test4");
ReportInfo[i][ReportStatus] = strval(reportstatus);
if(ReportInfo[i][ReportStatus] == 0) {status="{FF8000}Pending";}
if(ReportInfo[i][ReportStatus] == 1) {status="{00CC00}Open";}
format(str,sizeof(str),"%d\t%q\t%q\t%q\n", ReportInfo[i][ReportID], ReportInfo[i][ReportedName], ReportInfo[i][ReportedReason],status);
strcat(string2,str);
}
db_free_result(REPORTS_RESULT_FINAL);
}
printf("test5");
format(str,sizeof(str),"Report ID\tReported Name\tReason\tStatus\n%s", string2);
strcat(string,str);
ShowPlayerDialog(playerid, DIALOG_PENDINGREPORTS+1, DIALOG_STYLE_TABLIST_HEADERS, "Pending Reports", string, "Select", "Back");
printf("test6");
} else return ShowErrorDialog(playerid, "You are not authorized to use this command.");
return 1;
}
So printf("test4"); , printf("test5"); and printf("test6"); are never executed.
This is the only command with this problem. What could be the problem?
Check every line, between test3 and test 4 printf, if you've written it the right way. Try removing some of the lines and test them one for one. Sorry I can't help you in any other way because I'm not familiar with DB.