Error when i complie
#1

When i try to complie i get this eror: warning 204: symbol is assigned a value that is never used: "query"


at this line: new query[128], field[256], DBResult:result;
Reply
#2

The warning really says everything. The string 'query' is not being used. You'll have to use it or just remove it.
Reply
#3

Firstly, it's a warning, you don't need to worry about it because your script will function exactly the same with that warning, and the script will be compiled perfectly too. To resolve it, simple remove the text "query[128]," with the comma after the array closing square bracket.
Reply
#4

It's not an error but a warning, just remove 'query[128],' and it'll go away
Reply
#5

It's warning, not an error. Use it somewhere or delete it. It clearly says that it is never used.
Reply
#6

I think you're using the United Gaming RP II

For future reference, use ****** or read the entire topic on the forums because your question has been answered already!

You need to find the code:
pawn Код:
stock LoadLetters()
{
new query[128], field[256], DBResult:result;
result = db_query(MailDB, "SELECT * FROM `Letters`");
if (db_num_rows(result) != 0)
{
for (new i = 0, rows = db_num_rows(result); i < rows; i ++)
{
LetterInfo[i][LetterActive] = true;

db_get_field_assoc(result, "LetterUnread", field, sizeof(field));
LetterInfo[i][LetterUnread] = (strval(field) == 1) ? (true) : (false);

db_get_field_assoc(result, "LetterSent", field, sizeof(field));
LetterInfo[i][LetterSent] = (strval(field) == 1) ? (true) : (false);

db_get_field_assoc(result, "LetterAddress", field, sizeof(field));
format(LetterInfo[i][LetterAddress], 128, "%s", field);

db_get_field_assoc(result, "LetterSender", field, sizeof(field));
format(LetterInfo[i][LetterSender], 24, "%s", field);

db_get_field_assoc(result, "LetterRecipient", field, sizeof(field));
format(LetterInfo[i][LetterRecipient], 24, "%s", field);

db_get_field_assoc(result, "LetterMessage", field, sizeof(field));
format(LetterInfo[i][LetterMessage], 256, "%s", field);

LetterInfo[i][LetterSQL] = i;
db_next_row(result);
}
}
db_free_result(result);
return 1;
}
and change to:
pawn Код:
stock LoadLetters()
{
new field[256], DBResult:result;
result = db_query(MailDB, "SELECT * FROM `Letters`");
if (db_num_rows(result) != 0)
{
for (new i = 0, rows = db_num_rows(result); i < rows; i ++)
{
LetterInfo[i][LetterActive] = true;

db_get_field_assoc(result, "LetterUnread", field, sizeof(field));
LetterInfo[i][LetterUnread] = (strval(field) == 1) ? (true) : (false);

db_get_field_assoc(result, "LetterSent", field, sizeof(field));
LetterInfo[i][LetterSent] = (strval(field) == 1) ? (true) : (false);

db_get_field_assoc(result, "LetterAddress", field, sizeof(field));
format(LetterInfo[i][LetterAddress], 128, "%s", field);

db_get_field_assoc(result, "LetterSender", field, sizeof(field));
format(LetterInfo[i][LetterSender], 24, "%s", field);

db_get_field_assoc(result, "LetterRecipient", field, sizeof(field));
format(LetterInfo[i][LetterRecipient], 24, "%s", field);

db_get_field_assoc(result, "LetterMessage", field, sizeof(field));
format(LetterInfo[i][LetterMessage], 256, "%s", field);

LetterInfo[i][LetterSQL] = i;
db_next_row(result);
}
}
db_free_result(result);
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)