Stock function doesn't carry out - 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: Stock function doesn't carry out (
/showthread.php?tid=617857)
Stock function doesn't carry out -
963852741 - 27.09.2016
I have this stock
pawn Код:
stock SaveFurniture(id)
{
if(cache_num_rows())
{
new zString[256];
format(zString, 256, "%d,%s,%s", Furn[id][MATModel], Furn[id][MATTXD], Furn[id][MATTexture]);
format(szQuery, sizeof(szQuery), "UPDATE `newrp_furnitures` SET `fX` = %f, `fY` = %f, `fZ` = %f, `fRotX` = %f, `fRotY` = %f, `fRotZ` = %f, `materials` = '%s' WHERE `ID` = %d", Furn[id][poses][0], Furn[id][poses][1], Furn[id][poses][2], Furn[id][rot][0], Furn[id][rot][1], Furn[id][rot][2], zString, id);
mysql_query(sql, szQuery);
printf("[DEBUG]: A furniture was successfully saved.");
}
return 1;
}
And when I call the stock it doesn't carry out. It doesn't send the mysql query and doesn't send the debug message aswell.
Re: Stock function doesn't carry out -
Konstantinos - 27.09.2016
cache_num_rows returns failure because there's no active cache. Remove it completely.
Re: Stock function doesn't carry out -
Vince - 27.09.2016
I don't think you understand what cache_num_rows does because it is completely out of place in this context. Also if a function isn't universal and meant to work in any and all scripts then it shouldn't be declared stock.
Re: Stock function doesn't carry out -
963852741 - 27.09.2016
Quote:
Originally Posted by Konstantinos
cache_num_rows returns failure because there's no active cache. Remove it completely.
|
Quote:
Originally Posted by Vince
I don't think you understand what cache_num_rows does because it is completely out of place in this context. Also if a function isn't universal and meant to work in any and all scripts then it shouldn't be declared stock.
|
Appreciating your help. You two were right!
Re: Stock function doesn't carry out -
GoldenLion - 27.09.2016
https://sampforum.blast.hk/showthread.php?tid=570635