06.01.2018, 07:35
The problem appears to be your LoadHouses callback. Please check the syntax/parameters of cache_get_value_name_float, the first parameter is the row number, you are using houseid, this is likely resulting in the cache returning a non-existent row.
Instead of the first parameter being houseid it should be 0 as the row count will begin at 0.
You could also add a check to ensure that there is at least one row before selecting the value.
MySQL R40 wiki:
https://sampwiki.blast.hk/wiki/MySQL/R40
Instead of the first parameter being houseid it should be 0 as the row count will begin at 0.
You could also add a check to ensure that there is at least one row before selecting the value.
Код:
forward LoadHouses(houseid); public LoadHouses(houseid) { new numRows; cache_get_row_count(numRows); if(numRows == 0) return print("[MYSQL] MySQL returned no result for this query."); { new Float:test; cache_get_value_name_float(0, "X", test); printf("%f", test); } }
https://sampwiki.blast.hk/wiki/MySQL/R40