SA-MP Forums Archive
Error when i complie - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Error when i complie (/showthread.php?tid=461822)



Error when i complie - l1lwayn3 - 03.09.2013

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;


Re: Error when i complie - gtakillerIV - 03.09.2013

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


Re: Error when i complie - DanishHaq - 03.09.2013

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.


Re: Error when i complie - TonyII - 03.09.2013

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


Re: Error when i complie - Konstantinos - 03.09.2013

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


Re: Error when i complie - DJ_Shocker - 03.09.2013

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;
}