Stock function doesn't carry out
#1

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.
Reply
#2

cache_num_rows returns failure because there's no active cache. Remove it completely.
Reply
#3

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.
Reply
#4

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!
Reply
#5

https://sampforum.blast.hk/showthread.php?tid=570635
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)